Search code examples
androidsharedpreferencespreferenceactivity

Can I use Android PreferenceActivity / PerferenceManager to store a user managed list of strings?


My application requires a list of strings that is editable by the user.

There is a default list of strings but the user must be able to add or delete any number of strings. These changes need to be stored for use in multiple activities.

Is this something that the PreferenceActivity / PreferenceManager is able to do out of the box? Or does it require custom code? Or am I thinking in the wrong space entirely?

Thanks for your help


Solution

  • SharedPreferences are meant for small data like key-value pairs. It can also be used to store Sets.

    If the data is very big, better go for Database.