Hi guys,
I have 3 activities, Main Activity, and 2 child activity.
Here are the codes snippet in Main Activity
Sub Process_Globals
Dim SqlLt As SQL
End Sub
Sub Button1_Click
StartActivity(Child1)
End Sub
Sub Button2_Click
StartActivity(Child2)
End Sub
When Child2 Activity is active and user pressed back key, I want to quit from app, not return to Main Activity.
I tried these codes on Child2 Activity, but no avail
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
ExitApplication
End If
End Sub
If I changed codes for Button2_click on Main Activity to these one
Sub Button2_Click
Activity.Finish
StartActivity(Child2)
End Sub
It works as intended, but is this the correct procedure?
Thanks in advance.