i want to close the app when user click return button, using code below, but the app restart automatically.
if i change " Exit Application " to "Activity.Finish", the app will display blank screen and not close the apps.
Some Expert may help me, where is wrong in my code???
Thanks
Nicky
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
If Msgbox2("Do you want to close?", "", "Yes","", "No", Null) = DialogResponse.POSITIVE Then
ExitApplication 'App is exiting
Else
Return True
End If
End If
End Sub
if i change " Exit Application " to "Activity.Finish", the app will display blank screen and not close the apps.
Some Expert may help me, where is wrong in my code???
Thanks
Nicky