0

The app is using TJService.JavaClass._GetSTART_NOT_STICKY.

The service will stop if the user exits the app.

However, if the user swipes to remove the app from the Recent list, the service is still running.

I need to stop the service when the user swipes away the app.

How can the app detect this and stop the service?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • [What actually happens when you swipe an app out of the recent apps list?](https://android.stackexchange.com/questions/19987/) – Remy Lebeau Aug 20 '21 at 07:13
  • 1
    Could set the flag ServiceInfo.FLAG_STOP_WITH_TASK or handle onTaskRemoved in the service see: https://developer.android.com/reference/android/app/Service#onTaskRemoved(android.content.Intent – Brian Aug 20 '21 at 13:06
  • (https://stackoverflow.com/questions/9093271/start-sticky-and-start-not-sticky) – Freddie Bell Aug 21 '21 at 13:11
  • (https://stackoverflow.com/questions/34262554/how-to-check-if-a-service-is-running-in-delphi-10-seattle/34264464) – Freddie Bell Aug 21 '21 at 13:15

0 Answers0