NotificationManager.cancel() doesn't work: Notification isn't removed
问题 I've been trying to remove a persistent Notification set by a Service using: startForeground(1337, notification); The code I'm using to cancel it: NotificationManager nManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); nManager.cancel(1337); // cancel existing service notification, doesn't take effect nManager.cancelAll(); //surpluous, but also doesn't take effect To clarify why I am doing this: the Service starts with a default persistent Notification.