0
Im有困難清除狀態欄通知。清除狀態通知Android
public void NotificationStatus(){
Intent intent = new Intent(this, Stimulation.class);
NotificationManager notificationManager
= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Notification notification = new Notification(
david.flanagan.android.VenAssist.Activities.R.drawable.notification_icon,
"VenAssist Stimulation ON", System.currentTimeMillis());
PendingIntent activity = PendingIntent.getActivity(this, 0, intent, 0);
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notification.flags |= Notification.DEFAULT_VIBRATE;
notification.defaults |= Notification.DEFAULT_SOUND;
notification.setLatestEventInfo(this, "VenAssist",
"Stimulation Started", activity);
notificationManager.notify(0, notification);
}
我再試圖通過調用
notification.cancel(0);
我創建了通知的情況下,其即時通訊不能肯定是正確的清除在我服務的onDestroy()
功能的通知狀態。
private NotificationManager notification;
當我嘗試取消服務,因此清除狀態欄,應用程序崩潰。
我建議你貼堆棧跟蹤 – 2012-01-12 19:30:28