The following code make an app crash on Android 4.3.
The statement "Return true" within the KeyPress event and Back button produce an app crash.
It's a known problem ?
The statement "Return true" within the KeyPress event and Back button produce an app crash.
It's a known problem ?
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
'Intercept the back action in order to avoid unwanted app exit
If KeyCode = KeyCodes.KEYCODE_BACK Then
Select Msgbox2("Exit app?", "", "Yes", "", "No", Null)
Case DialogResponse.NEGATIVE
Return True
Case DialogResponse.CANCEL
Return True
Case DialogResponse.POSITIVE
Activity.Finish
End Select
End If
End Sub