// Choose a drawable to display as the status bar icon Wrox'com int icon = R.drawable.icon;
// Text to display in the status bar when the notification is launched String tickerText = "Notification";
// The extended status bar orders notification in time order long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
Prepared for ASHLEE KABAT, email: [email protected] Order number: 56760408 This PDF is for the purchaser's personal use in accordance with the Wrox Terms of Service and under US copyright as stated on this book's copyright page. If you did not purchase this copy, please visit www.wrox.com to purchase your own copy.
The ticker text will scroll along the status bar when the Notification is fired.
You can also set the Notification object'siumber property to display the number of events a status bar icon represents. Setting this value to a number greater than 1, as shown in the following line of code, overlays the values as a small number over the status bar icon:
As with all changes to a Notification, you will need to re-trigger it to apply the change. To remove the number overlay, set the number value to 0 or -1.
Was this article helpful?
Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.