27 Broadcast Intents

In this chapter you will polish PhotoGallery in two big ways. First, you will make the app poll for new search results and notify the user if new results are found, even if the user has not opened the application since booting the device. Second, you will ensure notifications about new results are posted only if the user is not interacting with the app. (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 making these updates, you will learn how to listen for broadcast intents from the system and how to handle such intents using a broadcast receiver. You will also dynamically send and receive broadcast intents within your ...

Get Android Programming: The Big Nerd Ranch Guide, 2nd Edition 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.