Configuring the Extended Status Notification Display

You can configure the appearance of the Notification within the extended status window in two ways:

1. Use the setLatestEventinfo method to update the details displayed in the standard extended status Notification display.

2. Set the contentView and contentlntent properties to assign a custom UI for the extended status display using a Remote View.

The simplest technique is to use the setLatestEventinfo method to populate the default status window layout. The standard extended status window layout shows the icon and time defined in the constructor, along with a title and a details string, as shown in Figure 9-4.

Notifications often represent a request for action or attention, so you can specify a Pendinglntent that will be fired if a user clicks the Notification item. In most cases that Intent should open your application and navigate to the Activity that provides context for the notification (e.g., showing an unread SMS or e-mail message).

Listing 9-20 uses setLatestEventinfo to set Notification values.

Mobile Apps Made Easy

Mobile Apps Made Easy

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.

Get My Free Training Guide


Post a comment