Get Notificationmanager Notificationmanager manager = (Notificationmanager) getsystemservice ( Context.notification_service); This method has been deprecated and is now using the Builder mode// Notification Notification = new Notification (R.drawable.icon3, "reminders", System.currenttimemillis ()); Builder mode Notification.builder builder = new Builder (this); Response after click pendingintent pendingintent = pendingintent.getactivity (this, 0, new Intent (This,mainactivity.class), 0 ); Builder.setsmallicon (R.drawable.icon) . Setwhen (System.currenttimemillis ()) . Setcontenttitle ("notification") . Setcontenttext (data) //@value String data = "Data" . SetDefaults (notification.default_lights | Notification.default_sound | notification.default_vibrate) . Setcontentintent (pendingintent); Manager.notify (3, Builder.build ()); Builder.getnotification (); method is deprecated, note using the build () method
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Notificatoin use