I want to trap the Back button using Erel's code, when the app is quit to open a dialog as modal so it can be used before quitting. I have a Panel loaded and using visible to show/hide. I do not want to use CustomDialog2 it is too large.
Is there ANY way to stop the app quitting before the dialog shows and is used?
[EDIT] Or if I used a quit button on screen to call my non-modal, is there a way to simulate the 'Back' button by calling something after my non modal is dismissed??
Is there ANY way to stop the app quitting before the dialog shows and is used?
[EDIT] Or if I used a quit button on screen to call my non-modal, is there a way to simulate the 'Back' button by calling something after my non modal is dismissed??
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
' If Msgbox2("Do you want to close?", "", "Yes", "Cancel", "No", Null) = DialogResponse.POSITIVE Then
***mypnl.visible=true, plus your solution, to go in here***
Return False
Else
Return True
End If
'End If
End Sub
Last edited: