I am working on a project, where while being on a specific Activity we show a local sticky notification. That should also be the case when the app is minimized. What I have
In general, if Android wants to kill your application because it has been in the background for too long (or because it wants to reclaim resources), Android will just simply kill the OS process hosting your app. It will not call finish()
or onDestroy()
on any Activity or Service components. The behaviour of "swipe from recent tasks list" has changed over time and is different in different Android versions. Someone should write a book about that :-(