M Mostez Well-Known Member Licensed User Longtime User Dec 3, 2020 #1 my application keeps service running even after program ends, how to stop a running service when application ends?
my application keeps service running even after program ends, how to stop a running service when application ends?
N Num3 Active Member Licensed User Longtime User Dec 3, 2020 #2 In android when you exit an application, it will not end immediately, the OS will determine when to "kill it". You can force the app to end using (not recommended): B4X: ExitApplication You can stop a running service using: B4X: StopService(ServiceName) Hope this helps. Also read Android Tutorial - Android Process and activities life cycle | B4X Programming Forum Upvote 0
In android when you exit an application, it will not end immediately, the OS will determine when to "kill it". You can force the app to end using (not recommended): B4X: ExitApplication You can stop a running service using: B4X: StopService(ServiceName) Hope this helps. Also read Android Tutorial - Android Process and activities life cycle | B4X Programming Forum
M Mostez Well-Known Member Licensed User Longtime User Dec 3, 2020 #3 That's exactly what I did, I called StopService then ExitApplication! Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 3, 2020 #4 In almost all cases it is a mistake to call ExitApplication. Just let the OS do its job and it will eventually kill the process. Upvote 0
In almost all cases it is a mistake to call ExitApplication. Just let the OS do its job and it will eventually kill the process.