Introducing Pending Intents

Android has a variation on an intent called a pending intent. In this variation, Android allows a component to store an intent for future use in a location from which it can be invoked again. For example, in an alarm manager, you want to start a service when the alarm goes off. Android does this by creating a wrapper pending intent around a normal corresponding intent and storing it away so that even if the calling process dies off, the intent can be dispatched to its target. At the time of the pending intent creation, Android stores enough information about the originating process that security credentials can be checked at the time of dispatch or invocation.

Let's see how we can go about creating a pending intent: ...

Get Pro Android 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.