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):
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.)
My suggestion had as a thought logic that, since the starter service is responsible for the app entry point, as well as optionally bars values, and since the op was cleaning the recent apps list, the service was still active but had nothing to call, since the app was no longer in background...
With the extra info from the OP, about the black (empty) activity, then yes, I think it's a problem with the layout loading
I'm sorry folks - I was loading Main everytime, alas it has no layout but it starts another activity if firsttime. I now start this activity everytime and it works!
Thanks a lot for your efforts everybody!