Obviously I have a poor understanding of B4XPreferenceDIalog. The entry form displays, but the entry boxes do not display for me to enter a simple First Name and a Last Name. I hope someone can see what I have failed to recognize.
Thank you. I have attached also the project:
Thank you. I have attached also the project:
B4X:
Sub Globals
Private txtFirstName As B4XView
Private txtLastName As B4XView
Private xui As XUI
Private Button1 As Button
Private prefdialog As PreferencesDialog
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1") ''has only button1
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Activity.finish
End Sub
Sub Button1_Click
prefdialog.Initialize(Activity, "Preference Dialog Input", 300dip, 300dip)
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 300dip, 300dip)
p.LoadLayout("MyDialog") 'has both EditText
Dim Data As Map = CreateMap("first": txtFirstName.Text,"last": txtLastName.Text)
Wait For (prefdialog.ShowDialog(Data, "OK", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Dim f As String =txtFirstName.Text
Dim l As String =txtLastName.Text
Dim strVar As String =$"My Name is ${f} ${l}"$
prefdialog.Dialog.Show(strVar, "OK", "", "")
Log(strVar)
End If
End Sub
Attachments
Last edited: