我想从 MultiSelectList 中获取选定的条目(不是 entryValue)。例如,如果选择值 1,我想得到“546544654”。现在我得到了价值观。你能帮助我吗?
MultiSelectListPreference list = (MultiSelectListPreference) findPreference("multiselectlist");
CharSequence[] entries = { "546544654", "12312", "98987","4342423","432423432" };
CharSequence[] entryValues = { "1", "2", "3","4","5" };
list.setEntries(entries); // entries type is String[]
list.setEntryValues(entryValues); // entryValues type is String[]
Set<String> selections = sharedPrefs.getStringSet("multiselectlist", null);
for (String str: selections){
Log.d("salida", str);
}