I have the next code:
The app works fine in the emulator but when I try in a phone (moto G) or in a tablet (nexus 7) the app crashes in both cases (pressing 'yes' or pressing 'no').
The log window doesn´t show anything
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
Dim result As Int
If KeyCode = KeyCodes.KEYCODE_BACK Then
result= Msgbox2("Do you want to exit?", "", "Yes", "", "No", Null)
If result = DialogResponse.POSITIVE Then
Activity.Finish
Else
Return True
End If
End If
End Sub
The app works fine in the emulator but when I try in a phone (moto G) or in a tablet (nexus 7) the app crashes in both cases (pressing 'yes' or pressing 'no').
The log window doesn´t show anything