ARTICLE AD BOX
I am developing an Android application using Kotlin. I want my app to continue running even after the user removes it from the recent tasks list (swipes the app away).
Currently, when the user removes the app from the recent apps screen, the process stops and the service also stops. I would like the application (or a background service) to keep running.
I tried using a Foreground Service and START_STICKY, but the service still stops when the app is removed from the recent task list.
My questions:
Is it possible to keep the app running after it is removed from the recent tasks list?
What is the recommended approach in Android for this situation?
Should I handle this using onTaskRemoved() or another mechanism?
The app is written in Kotlin and targeting modern Android versions.
Any guidance or example code would be appreciated.
