B4X:
Sub activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
If Msgbox2("Do you want to close the app?", "Close App","Yes","Logout","No", Null) = DialogResponse.POSITIVE Then
Activity.Finish
else if DialogResponse.CANCEL Then
Activity.LoadLayout("frmlogin")
Else
End If
Return True
End If
End Sub
having error when pressing logout(DialogResponse.CANCEL)
B4X:
Error Occured
An error has occured in
Sub: main_activity_keypress
(java line:357)
java.lang.RuntimeException:
Cannot parse: -3 as boolean