The Activity_Pause event is not getting fired when Home key is pressed.
The Home key just closes the app without any warning.
(This is part of a larger app where it wasn't working, therefore I just put it in a new project)
B4X:
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
The attached project contains the above code in ready to run form.