Using RTC_WAKEUP
with a service PendingIntent
, as you are doing here, is unreliable. Moreover, it would have nothing to do with your onReceive()
method. You need to use a broadcast PendingIntent
if you want a BroadcastReceiver
to get control when the alarm event occurs.
If you want to use a _WAKEUP
alarm, I strongly suggest that you use WakefulBroadcastReceiver
or my WakefulIntentService
, rather than hand-rolling your own WakeLock
logic.