Sub btnCustom_Click
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 300dip, 150dip)
p.LoadLayout("CustomDialog")
dialog.PutAtTop = True 'put the dialog at the top of the screen
Dim rs As ResumableSub = dialog.ShowCustom(p, "OK", "", "CANCEL")
fieldFirstName.TextField.RequestFocus 'add TextField
IME.ShowKeyboard(fieldFirstName.TextField) 'add TextField
Wait For (rs) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
dialog.Show(fieldFirstName.Text & " " & fieldLastName.Text, "OK", "", "")
End If
End Sub