I manage an ONGOING notification from my application (not from a service).
When I kill application from task manager with \"End\" button, no
The ability to swipe apps out of the recent apps list is introduced in Ice Cream Sandwich (API-14).
With the same Android version, we received a special method "onTaskRemoved()" in "android.app.Service". It is get invoked when app is removed from recent apps list.
So, just override "onTaskRemoved()" method to achieve your requirements if you are having any service running.
E.g.:
@Override
public void onTaskRemoved(Intent rootIntent) {
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(NOTIFICATION_ID);
}
Or simply write & start special service to manage the same.