Sub Activity_KeyPress(KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
CallSubDelayed(Me, "HandleBackKey")
Return True
End If
Return False
End Sub
Sub HandleBackKey
Dim Answ As Int
Dim Txt As String
Txt = "Do you really want to close the app ?"
Answ=Msgbox2(Txt,"ATTENTION","Yes","","No",Null)
If Answ=DialogResponse.POSITIVE Then
CloseApp
End If
End Sub
Sub CloseApp
' Close DB
' Close KeyValueStore
ExitApplication
End Sub