tsteward Well-Known Member Licensed User Longtime User Apr 9, 2021 #1 At the moment when a user clicks the swiftbutton to open the searchtemplate if they press back it closes the activity. Is there a way I can simulate clicking the Cancel button or just close the searchtemplate
At the moment when a user clicks the swiftbutton to open the searchtemplate if they press back it closes the activity. Is there a way I can simulate clicking the Cancel button or just close the searchtemplate
tsteward Well-Known Member Licensed User Longtime User Apr 10, 2021 #2 Solved my issue B4X: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then If dialog.Visible=True Then dialog.Close(xui.DialogResponse_Cancel) Return True End If End If End Sub Upvote 0
Solved my issue B4X: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then If dialog.Visible=True Then dialog.Close(xui.DialogResponse_Cancel) Return True End If End If End Sub