I allow my users to use the Escape key to close windows and shut down the app. For one of the app windows (not the main window), I intercept it like so:
I have a B4XPages_CloseRequest() Sub set up that is not getting triggered by the B4XPages.ClosePage(Me) call in the above Sub.
The B4XPage_CloseRequest Log output never happens.
What am I missing?
B4X:
Sub KeyPressed_Filter (e As Event)
Dim jo As JavaObject = e
Dim EventType As String = jo.RunMethodJO("getEventType", Null).RunMethod("getName", Null)
If EventType = "KEY_RELEASED" Then
Dim keycode As String = jo.RunMethod("getCode", Null)
If keycode = "ESCAPE" Then
B4XPages.ClosePage(Me)
e.Consume
End If
End If
End Sub
I have a B4XPages_CloseRequest() Sub set up that is not getting triggered by the B4XPages.ClosePage(Me) call in the above Sub.
B4X:
Private Sub B4XPage_CloseRequest As ResumableSub
Log("Closing the window!")
Return True
End Sub
The B4XPage_CloseRequest Log output never happens.
What am I missing?
Last edited: