Search code examples
androidandroid-preferencespreferenceactivityandroid-sharedpreferences

forcing a notifyChanged() on a ListPreference


I have a ListPreference and would like to achieve a behavior equivalent to a notifyChanged() every time I click on a ListPreference item even if this item is the currently selected one.

What is the best way to achieve this?


Solution

  • I was using DropDownPreference and this library: https://github.com/Gericop/Android-Support-Preference-V7-Fix. It seems that simply switching to a ListPreference solved my issue. Clicking on an already selected item from the list will trigger notifyChanged().