This is correct. UserClosed will be false which means that the user didn't press on the back button.If you press the Home key, the Activity_Pause() fires yes? (But you can't tell why it fired).
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
Dim result As Int
result = Msgbox2 ("QUIT?",KeyCode & " PRESSED","YES","","NO",Null)
If result=DialogResponse.POSITIVE Then
Msgbox ("Entered YES","")
Return False
Else
Msgbox ("Entered NO","")
Return True
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
' If UserClosed = True Then
Msgbox("Activity closed in PAUSE EVENT","")
ExitApplication
' End If
End Sub