如何设置 ListPreference 的默认值?
对于我使用的 EditTextPreference
editor.putString("name","defaultvalue");
但这在 ListPreference 中不起作用。
我该怎么做?
最佳答案
从 xml 做:
android:defaultValue
或:
onSetInitialValue(boolean restoreValue, Object defaultValue)
// Implement this to set the initial value of the Preference.
关于android - 设置 ListPreference 的默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6154731/