I was wondering if there is a way to ensure a user actually wants to leave an app. For instance, I figured out the back button using KeyCodes. However, it seems that this is not available for either the home or the overview buttons.
I then checked this page to see if I could find anything.
Views (Core)
It appears that message boxes cannot exist within the Activity_Pause Sub, so that (I assume) would not work.
I'm hoping I'm missing something obvious, so this might be an easy question.
Any help would be much appreciated, thanks!
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Select Msgbox2Async("Are you sure you want to exit?","WARNING","Yes","No","",Null,False)
Case DialogResponse.POSITIVE
Activity.Finish
Case Else
Return True
End Select
End If
End Sub
I then checked this page to see if I could find anything.
Views (Core)
It appears that message boxes cannot exist within the Activity_Pause Sub, so that (I assume) would not work.
I'm hoping I'm missing something obvious, so this might be an easy question.
Any help would be much appreciated, thanks!