From the course: Android Development: Understanding Intents

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Pending intents

Pending intents - Android Tutorial

From the course: Android Development: Understanding Intents

Start my 1-month free trial

Pending intents

- [Instructor] In this example, we're going to look at pending intents. A pending intent is essentially a wrapper around an existing intent, and they are used to grant the ability to another application to fire the intent as if it were executed from your app's process. There's a variety of scenarios why you'd want to do this. But one of the most common ones is notifications. When you create a notification in your app, you can attach an intent to that notification that tells Android which activity in your app should be started when the user taps on the notification. So, let's go ahead and try that out. Here in my AppsActivity.java file, I've scrolled down to the section where we handled the pending intent button click. Let me just close that down so we have more room. I already have some code here that creates a sample notification, so don't worry too much about the code you see here. It's beyond the scope of this course to go deep into how notifications work. What I need to do though…

Contents