Android Question B4A Preferencedialog set item option value

mike1967

Active Member
Licensed User
Longtime User
Hello,in a Preferencedialog form how can i set via code the options list value of a options fields?Thanks in advances
 

josejad

Expert
Licensed User
Longtime User
Hi:

Use .SetOptions

B4X:
    B4XPref.LoadFromJson(File.ReadString(File.DirAssets, "yourfile.json"))
    Dim List1 As List
    List1.Initialize
    List1.AddAll(Array As Int(1, 2, 3, 4, 5)) 
    B4XPref.SetOptions("yourField",List)
    Wait For (B4XPref.ShowDialog(m, "OK", "CANCEL")) Complete (Result As Int)
 
Upvote 0

mike1967

Active Member
Licensed User
Longtime User
Hi:

Use .SetOptions

B4X:
    B4XPref.LoadFromJson(File.ReadString(File.DirAssets, "yourfile.json"))
    Dim List1 As List
    List1.Initialize
    List1.AddAll(Array As Int(1, 2, 3, 4, 5))
    B4XPref.SetOptions("yourField",List)
    Wait For (B4XPref.ShowDialog(m, "OK", "CANCEL")) Complete (Result As Int)
Thanks.
 
Upvote 0
Top