I want to show up a notification when my app is removed from the recent apps list. I've tried putting code for that in
When you swipe your app out of Recents, its task get killed instantly. No lifecycle methods will be called.
To get notified when your app getting swiped out of Recents, you could start a sticky
Service and override its
From the documentation of
This is called if the service is currently running and the user has removed a task that comes from the service's application. If you have set
ServiceInfo.FLAG_STOP_WITH_TASKthen you will not receive this callback; instead, the service will simply be stopped.