Sub Activity_KeyPress (key As Int) As Boolean
Dim rs As Int
If key=KeyCodes.KEYCODE_BACK Then
rs= Msgbox2("Close app " ,"Going Back","Yes","Cancel","No",Null)
If rs=DialogResponse.POSITIVE Then
StopService(Starter)
Activity.Finish
ExitApplication
Else
Return True
End If
End If
' Returning False signals the system to handle the key
Return False
End Sub