source: this post
//Retrieve the values
Set<String> set = myScores.getStringSet("key", null);
//Set the values
Set<String> set = new HashSet<String>();
set.addAll(listOfExistingScores);
scoreEditor.putStringSet("key", set);
scoreEditor.commit();
- is
myScores
refers to sharedpreference? - what is
listOfExistingScores
refers to? is it ArrayList? - is
scoreEditor
refers to ArrayList? or ListView? or custom ListView?