Android Question [B4A] Move cursor at the end of text in InputDialog

ziovec

Member
Licensed User
Hello there!
I'm using this Dialog library to pop-up some InputDialog.

Those dialogs are shown when the user wants to edit some data in the app.
The actual value is shown in a Label.
When the InputDialog is called, I managed to show in the edit text area the actual value of the linked Label, but the cursor is at the very beginning of the text and I'd like to move it to the end...or even have the text fully selected.
Whatever the case, I can't find a way to do it.
Should I use a CustomDialog, maybe?


B4X:
    Dim id As InputDialog
    id.InputType = 0x00000003
    If kvs.Get("Tel") <> Null Then
    id.Input = kvs.Get("Tel")
    End If
    Dim ev As Object = id.ShowAsync("", "Numero di telefono:", "Ok", "", "Annulla", Null, False)
    Wait For (ev) Dialog_Result(Result As Int)
    If Result = DialogResponse.POSITIVE Then
        kvs.Put("Tel",id.Input.Trim)
        lblTel.Text = kvs.Get("Tel")
    End If
 

Mahares

Expert
Licensed User
Longtime User
The lib you are using is 10 years ols. I am pretty sure if Erel sees your thread, he will recommend B4XDialog with B4XInputTemplate. Here is a small example you can apply to your situation, after you expose the native view:
B4X:
Dim input As B4XInputTemplate
    input.Initialize
    input.lblTitle.Text = "Please enter the info:"
    Dim et1 As EditText= input.TextField1  
    input.Text="forum"
    et1.SelectAll
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…