I need to save on shared preferences some array of Strings and after that to get them.
I tried this :
prefsEditor.putString(PLAYLISTS, playlists.toString()); where playlists is a String[]
and to get :
playlist= myPrefs.getString(PLAYLISTS, "playlists"); where playlist is a String but it is not working.
How can I do this?
You can create your own String representation of the array like this:
Then when you get the String from SharedPreferences simply parse it like this:
This should do the job.