Android Question B4XPreferencesDialog, how to select Options item

james_sgp

Active Member
Licensed User
Longtime User
Hi,

How can I select an item in the 'shortoptions' list from code, in a B4xPreferencesDialog. Setting other items is simple; but can`t figure how to do this?

Thanks, James
 

aeric

Expert
Licensed User
Longtime User
You mean set the default value when the ShowDialog is called?
Just set the map key-value pair to pass to the view.

Eg.

B4X:
Private Sub btnOptions1_Click
    Options1.Put("opt1", "Green")
    Wait For (prefdialog.ShowDialog(Options1, "OK", "CANCEL")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then       
        PrintOptions(Options1, TextArea1)
    End If
End Sub
 
Upvote 0
Top