Activity.finish StartActivity ("TWO")
Activity.finish StartActivity ("THREE")
Activity.finish StartActivity ("ONE")
But what happen if the user is in the main activity (last activity) ? activity_resume isn't fire. This is what I have in the main activity:Use a process global variable as a flag to indicate that the app is quitting. Check the value of this variable in Activity_Resume of all activities.
If it is true then call Activity.Finish.
In the last activity (assuming that you know which activity is the first in the stack) you should call ExitApplication.
Sub Process_Globals dim blCloseApp=False as boolean end sub Sub Activity_Resume if blCloseApp then ' AGAIN ?????? Activity.Finish ExitApplication end if end sub Sub Activity_KeyPress(KeyCode As Int) As Boolean If KeyCode = KeyCodes.KEYCODE_BACK Then Dim result As Int result = Msgbox2("Close App?", "Exit", "Yes", "", "No", Null) If result = DialogResponse.Positive Then blCloseApp=True Activity.Finish ExitApplication Else Return True End If End If End Sub