I. Notification
Pushmessagebutton = (Button) Findviewbyid (r.id.pushmessage); Final Bitmap LargeIcon = ((bitmapdrawable) getresources (). getdrawable (R.drawable.stefan)). Getbitmap (); Final Notificationmanager manager = (Notificationmanager) getsystemservice (Context.notification_service); Pushmessagebutton.setonclicklistener (New View.onclicklistener () {@Override public void OnClick (View V) {pendingintent pendingintent = pendingintent.getactivity (baidumapactivity.this, 0, New Intent (). setact Ion (Intent.action_view), 0); Notification notify= New Notification.builder (baidumapactivity.this). Setsmallicon (R.drawable.head_ image). Setlargeicon (LargeIcon). Setticker ("You have a new short message, please check!"). "). Setcontenttitle (" Notification Title "). Setcontenttext (" This is the Notif Ication message "). Setcontentintent (PendingIntent). Setnumber (1). GetNotification (); Notify.flags |= Notification.flag_auto_cancel; FL manager.notify (1,notify); } });Two. Questions
No notification notifications are displayed.
three. Resolve
1. Please set icon
2. If the API is 16, replace getnotification () with Build (), refer to: http://blog.csdn.net/loongggdroid/article/details/17616509
Android Development: Notification notifications and notifications do not show issues