Android Question How to completely force stop apps and services?

amorosik

Expert
Licensed User
I have an app made up of some services (mqtt, ftp, gps, http, sms..), some forms and some code modules
I would like to allow the operator, when desired, to shut down app operation completely to save precious battery energy
I tried various systems but 'something' always remains in memory and I keep seeing the small notification at the top left

B4X:
Dim jo As JavaObject
jo.InitializeContext
jo.RunMethod("finishAffinity", Null)

Dim jo As JavaObject
jo.InitializeContext
jo.RunMethod("finishAffinity", Null)

Activity.Finish

ExitApplication

Only from the operating system and by forcing the closure the app shuts down permanently
The question is: from b4A code inside the app, how to turn it off completely (activity+modules+services)?
 
Top