我有下面的代碼來創建一個ONGOING_EVENT
:隱藏正在進行的通知
Notification notification = new Notification(R.drawable.icon, "someText" , System.currentTimeMillis());
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notification.flags |= Notification.FLAG_FOREGROUND_SERVICE;
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, Home.class), 0);
notification.setLatestEventInfo(this, "someTitle", "someText", contentIntent);
notificationManager.notify(SOME_ID, notification);
現在,我要殺死它以後:
notificationManager.cancel(SOME_ID);
但是,通知保持。這可能是什麼原因?
http://stackoverflow.com/questions/5232650/android-notification-delete這可能有助於您的博愛。 – drooooooid