I want to read my string arrays entries from SharedPreferences that were saved via MultipleSelectListPreferences.
getStringSet() seems to be the only method on SharedPreferences that fits the requirements.
How do I extract the saved String array with this method – I don’t understand how to get the array from a String set.
I have provided a simple example of how to read a MutipleSelectListPreference into set and then, convert it into an String array and save it into a String.
First you read your sharedPreferences into the mySet object:
Then you can define String array, iterate through the mySet and save each string into one fromSet string: