I created an app that opens 3-4 activity. When I last activity, I want to return to the main at once.
To do this, I used the following code:
B4X:
Activity.Finish
StartActivity (Main)
when I leave the app from the main, reappears the last open activity.
Is there a way to permanently destroy the activity before going into the Main, so not reopen when I leave the app?
Now I should find a way to call all other previous activity that were "in pending". Is there a way to close them all recursively, type close to the activity?
You need to create a process global "close" variable and check its status in the Activity_Resume of all the relevant activities. If it is true close the current activity.
Erel,
I would try to create a list of activity that have been opened (in the path of opening various activty) and call the Finish of all activity on the list.
I can not do it in a form because they do not like that I create a list of activity !?