O'Reilly logo

Android™ Tablet Application Development For Dummies® by Donn Felker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating a Notification

At some time, you may need to update the view of your notification. Consider the following situation: You have some code that runs in the background to see whether the tasks have been reviewed. This code checks to see whether any notifications are overdue. You decide that after the two-hour mark passes, you want to change the icon of the notification to a red-colored exclamation point and flash the LED quickly with a red color. Thankfully, updating the notification is a fairly simple process.

If you call one of the notify() methods with an ID that is currently active in the status bar, and with a new set of notification parameters, the notification is updated in the status bar. Therefore, to update your notification, simply create a new Notification object with the red icon as a parameter and call notify().

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required