Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = 82 Then ' Menu key
StartActivity("settings")
Return True
End If
If KeyCode = 4 Then ' Back Key
i = Msgbox2("Exit Application?", "MyApp", "Yes", "", "No", bmpAppIcon)
If i = DialogResponse.POSITIVE Then
Activity.Finish
End If
Return True
End If
End Sub