Android Question Solved - how to close SearchTemplate (XUI Views) programatically

tsteward

Well-Known Member
Licensed User
Longtime User
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
Solved my issue
B4X:
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
Top