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 KeyCode
Case KeyCodes.KEYCODE_BACK
'App exit
Private Answ As Int
Answ = Msgbox2("Vuoi uscire dall'App ?", "", "Si", "", "No", Null)
If Answ = DialogResponse.POSITIVE Then
Activity.Finish
Else
Return True
End If
End Select
End If
End Sub
End Select
End If
End Sub