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好工作;) –