Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
If Msgbox2("Are you sure to exit?", "", "Yes", "", "No", Null) = DialogResponse.POSITIVE Then
Return False
ExitApplication '...or whatever other previous killing actions.
Else
Return True
End If
Else
Return False ' Handle the other presses in the OS
End If
End Sub