amorosik Expert Licensed User Longtime User Mar 30, 2023 #1 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)?
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)?
OliverA Expert Licensed User Longtime User Mar 30, 2023 #2 Call StopService on all your services before quitting the Activity? See https://www.b4x.com/android/forum/pages/results/?query=Stopservice Upvote 0
Call StopService on all your services before quitting the Activity? See https://www.b4x.com/android/forum/pages/results/?query=Stopservice
amorosik Expert Licensed User Longtime User Mar 30, 2023 #3 Oh yeah, that was obviously it Added some StopService and now everythingcloses as desired Thanks bye Upvote 0