I have an app with an activity and an intent service running in the background.
There\'s also a notification which shows a progress bar with the progress of the backg
Did you tried onStop ? It worked for me. I called cancelAll() in onStop. It closes all notification on removal of app from task Manager.
Note : But it also remove all notification when your app goes in background. In that case you can re invoke those notification using background process.
@Override public void onStop (){
super.onStop();
cancelAllNotification(getApplicationContext());
}
public static void cancelAllNotification(Context ctx) {
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager nMgr = (NotificationManager) ctx.getSystemService(ns);
nMgr.cancelAll();
}