User can see all the detail of a notification by opening the Notification Drawer
Android Notification has 2 views: Normal View and Big View. In this post, I only focus on Normal View. Big View will have its own entry later :)
To push a notification, first of all, you need to create a NotificationManager object:
Then, create a Notification object:
The constructor of Notification has 3 arguments:
After that, create a PendingIntent instance by calling PendingIntent.getActivity() method. This instance will start an activity when user tap on the notification.
Assign the latest notification by setLatestEventInfo() method:
Push the notification:
The notify() method has 2 arguments:
The result of this demo application:
http://www.mediafire.com/download.php?uh37y8qmtiwr65c
Comments powered by Disqus.