I have a list Preference that created from resource xml. I added preference that created dialog in which user can add value to listPreference.
using those methods i added new value:
entries = getEntries();
entryValues = getEntryValues();
when user is adding values to listpreference, its displayed. But when preferenceScreen is recreating new value disappearing.
How can i save those new values?
Problem is that when you’re reopening your
PreferenceScreen, it loads theListPreference‘s values from XML. You can change this behavior using thesetEntries()andsetEntryVaues()methods ofListPreference. Of course you need to somehow store all the values and their indexes that your users enter. You can use databases orSharedPreferencesfor it. Hope this helps.EDIT
Saving the value of a
ListPreferenceinto theSharedPreferences: