Android Question ShowKeyboard don't work with B4XDialog and CustomLayout

asales

Expert
Licensed User
Longtime User
I tried to change the text of the label using B4xDialog and a customlayout with an edittext multline.

I want to show the keyboard when the dialog opens, but don't works.

My code and the project is in attached.

Thanks in advance for any tip.

B4X:
Sub Globals
    Private Label1 As Label
    Dim IME As IME
    
    Private dialog As B4XDialog
    Private xui As XUI
    Private edtMsg As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
    IME.Initialize("IME")    
    Activity.LoadLayout("1")    
    dialog.Initialize(Activity)
End Sub

Sub Label1_Click
    dialog.Title = "Change Text"
    dialog.BackgroundColor = xui.Color_White
    dialog.ButtonsColor = xui.Color_White
    dialog.ButtonsTextColor = dialog.TitleBarColor
    dialog.BorderColor = xui.Color_Transparent
    
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 90%x, 200dip)
    p.LoadLayout("CustomLayout")
    edtMsg.Text = Label1.Text
    IME.ShowKeyboard(edtMsg)
    
    Wait For (dialog.ShowCustom(p, "Confirm", "", "Cancel")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Label1.Text = edtMsg.Text
    End If
End S
 

Attachments

  • b4xdialogkeyboard1.zip
    13.3 KB · Views: 152
Top