Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then 'Detecta que se ha pulsado la tecla RETURN.
If Msgbox2("¿QUIERES SALIR DE LA APLICACION?", "Mi aplicacion", "SI", "CANCELAR", "NO", Null) = DialogResponse.POSITIVE Then
Activity.Finish
ExitApplication
Else
Return True
End If
End If
End Sub