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
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