28 Broadcast Intents

It is annoying and redundant to both get a notification and see the results update in the screen when you are actively viewing an app. In this chapter, you will polish PhotoGallery’s polling behavior by preventing notifications about new photos from appearing while the app is running.

In making these updates, you will learn how to listen for broadcast intents and how to handle such intents using a broadcast receiver. You will also dynamically send and receive broadcast intents within your app at runtime. Finally, you will use ordered broadcasts to determine whether your application is currently running in the foreground.

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.