christmas
christmas

Reputation: 31

how can i set the value checked in ListPreference

I have some problems with using ListPreference, when i set the value with useing ListPreference.setEntries() and ListPreference.setEntryValues() , then the value was set ,but is was not checked , i tried the ListPreference.setEnabled(true) and ListPreference.setSelectable(true), but it was about the ListPreference , not the values in ListPreference, any method to make it checked with coding after i set the value?

thanks

Upvotes: 3

Views: 4437

Answers (1)

mrdready
mrdready

Reputation: 111

To default the selected item in a listPreference, use setValueIndex

Upvotes: 11

Related Questions