0
我正在使用它在後臺通知用戶正在進行的服務。如何在服務完成時擺脫正在進行的通知?
nm = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
CharSequence from = "App";
CharSequence message = "Getting Latest Items...";
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(), 0);
notif = new Notification(R.drawable.icon,
"Getting Latest Items...", System.currentTimeMillis());
notif.setLatestEventInfo(this, from, message, contentIntent);
notif.flags = Notification.FLAG_ONGOING_EVENT;
nm.notify(1, notif);
現在,當服務完成後,我該如何得到這個消失?
如何讓通知被點擊時消失? – yoshi24
@ yoshi24:請在這裏看看這個問題,它會回答你的上述問題的評論:http://stackoverflow.com/questions/3479428/android-notification-intent-to-clear-it-self – Viren