1
private void triggerNotification(String s)
{
CharSequence title = "TASK";
CharSequence message = s;
notificationManager = (NotificationManager)c.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.vianetlogo, s, System.currentTimeMillis());
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_VIBRATE;
PendingIntent pendingIntent = PendingIntent.getActivity(c, 0, null, 0);
notification.setLatestEventInfo(c, title, message, pendingIntent);
notificationManager.notify(NOTIFICATION_ID, notification);
}
如果同时存在多个通知,则会在状态栏中保存上次通知。有没有什么办法,这将节省状态栏多发的通知?Android状态栏通知
它的工作!!!!!!!!!!!! – user533844
@ user533844好工作;) –