Search code examples
androidsharedpreferencesandroid-preferencespreferencelistpreference

How to make a Preference not save to SharedPreferences?


I am re-using ListPreference for a setting which I store only in the database. How can I prevent it from storing/persisting any data to the preference file?


Solution

  • Subclass it, override shouldPersist() to return false.