Android Question Stopping a service when the app is cleared from Recent app

Najirm

Member
Licensed User
Longtime User
I start the service as

B4X:
StartServiceAt("UpdateService", DateTime.Now + 60 * DateTime.TicksPerSecond, True)

But when the app is closed from the recent app list the service still runs in the background.

Is there a way I can stop the service when the app is cleared from the recent app list? or any other event or method called when the app is cleared from the recent app list?
 

Najirm

Member
Licensed User
Longtime User
CancelScheduledService works when I call this inside the click event of the shutdown button.

How can I call this when the app is cleared from the recent app list?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
you cant as you did not get noticed about it.
 
Upvote 0
Top