General mobile phone has a status bar, showing battery power, signal strength, missed calls, SMS ... There is also a status bar above the Android screen. The notice here is that the notification is displayed on this status bar.
The steps to send notifications are as follows:
1). Get Notification Manager
Notificationmanager Mnotificationmanager = (notificationmanager)
2). Create a new notification that specifies its icon and caption
inticon =Android. R.drawable.stat_notify_chat;Longwhen =System.currenttimemillis ();//The first parameter is an icon, the second argument is a caption, and the third is the notification timeNotification Notification =NewNotification (Icon,NULL, when); Intent openintent=NewIntent ( This, Otheractivity.class);//openintent Intent is sent to the system when a message is clickedPendingintent contentintent = pendingintent.getactivity ( This, 0, openintent, 0); Notification.setlatesteventinfo ( This, "title", "Content", contentintent); mnotificationmanager.notify (0, notification);
Notifications in Android