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 - Android Tutorial
From the course: Android Development: Understanding Intents
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.