Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
res = Msgbox2("Do you want to exit?", "", "Yes", "", "No", Null)
If res = DialogResponse.NEGATIVE Then Return True
End If
Return False
End Sub