It depends a little on whether it is a signal _WAKEUPor not.
If not, feel free to use getService() PendingIntent.
If, however, it is an alarm _WAKEUP, you need to not only use the intermediary BroadcastReceiver, but you BroadcastReceivermust also get WakeLockone that will be released later IntentService. The requirement BroadcastReceiveris related to how it AlarmManagerprocesses its own WakeLock. I have simplified the implementation of this process as WakefulIntentService.
source
share