Android Question How to SelectAll text in an InputDialog?

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I am using an InputDialog to request the user information. I would like the default text to be selected, but I do not know how to do it.
This is the code I am using:

B4X:
Sub InputBox( cTitle As String, cQuestion As String, cDefaultText As String )  As ResumableSub
    Dim id As InputDialog
    id.InputType = id.INPUT_TYPE_TEXT
    id.Input = cDefaultText

   ''' id.EditText.SelectAll  ' I do not know what to put here. <-----

    Dim sf As Object = id.ShowAsync(cQuestion,cTitle,"Ok","Cancel","",Null,False)
    Wait For (sf) Dialog_Result(iResult As Int)
    If iResult=DialogResponse.POSITIVE Then
        Return id.Input
    Else
        Return DialogResponse.CANCEL
    End If   
End Sub
Thank you.
 
Top