Hello!
I need to exit an app completely from an Activity that is not Main. When I use Activity.Finish this only finishes the running Activity but not the application. ExitApplication however restarts Main. In another thread I found the following solution (posted by Erel):
This works fine, but then the app cannot be started again. I have to close it by hand in 'Recent apps' to be able to restart it.
How can I close it completely?
(I would have posted in the above mentioned thread but there it says one should rather open a new thread.)
I need to exit an app completely from an Activity that is not Main. When I use Activity.Finish this only finishes the running Activity but not the application. ExitApplication however restarts Main. In another thread I found the following solution (posted by Erel):
B4X:
Sub CloseActivities
Dim jo AsJavaObject
jo.InitializeContext
jo.RunMethod("finishAffinity", Null)
End Sub
This works fine, but then the app cannot be started again. I have to close it by hand in 'Recent apps' to be able to restart it.
How can I close it completely?
(I would have posted in the above mentioned thread but there it says one should rather open a new thread.)