Sub activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Private ans As Int
ans = Msgbox2("Do you want to close the app?", "Close App","Yes","Logout","No", Null)
If ans = DialogResponse.POSITIVE Then
Activity.Finish
Else If ans = DialogResponse.CANCEL Then
Activity.LoadLayout("frmlogin")
Else
End If
Return True
End If
End Sub
Sub activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Private ans As Int
ans = Msgbox2("Do you want to close the app?", "Close App","Yes","Logout","No", Null)
If ans = DialogResponse.POSITIVE Then
Activity.Finish
Else If ans = DialogResponse.CANCEL Then
Activity.LoadLayout("frmlogin")
Else
End If
Return True
Else 'Add this.
Return False 'Add this.
End If
End Sub