You've learned how to execute actions such as starting new activities with intents, and you've also learned how to send and receive data with broadcast messages—both those supported directly in the Android SDK and with open source libraries such as EventBus. Learn how to combine these two concepts by sending a message to an external application using a class named PendingIntent, and then see what happens when a message comes bouncing back to your own app.
- [Instructor] I've previously shown how to execute actions…such as starting new activities with intents…and I've also described how to send…and receive data with broadcast messages.…Now I'll combine those two concepts…by sending a message to an external application…using a class named pending intent…and then show what happens when a message…comes bouncing back to my own application.…A pending intent is a wrapper around an intent object.…You first create an intent…that gives your own application some instruction…to start an activity or a service,…or to send a broadcast.…
You wrap it in a pending intent…and send it to another wrap,…sometimes called the foreign app.…That app can then save the pending intent…and when it's ready it can send it back…to your own application.…Your app can then execute…the original intent's instructions.…If the requested action needs a particular permission,…you can declare that permission in your app's manifest.…The foreign app doesn't need the permission…and it doesn't even need to know specifically…
Released
6/15/2017David also shows how to send and receive broadcast messages that let you exchange data and notifications among the different tiers of your application. He demonstrates how to work with menus and the action bar, add a navigation drawer to a layout, and tackle advanced navigation techniques. Later courses in the Essentials series concentrate on other specific skills you can master.
- Working with events
- Handling events with Java objects and lambda expressions
- Managing navigation
- Sending data to an activity
- Opening other apps with implicit intents
- Sending and receiving broadcast messages
- Working with menus and the action bar
- Adding a navigation drawer
- Advanced navigation techniques
- Removing activities from the back stack
Share this video
Embed this video
Video: Delay broadcasts with PendingIntent