protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.a
You can store string sets in Shared Preferences, then convert them back to a List when you retrieve them.
ArrayList<String> list = new ArrayList<String>();
list.add("test1");
list.add("test2");
PreferenceManager.getDefaultSharedPreferences(context)
.edit()
.putStringSet("stringset", new HashSet<String>(list))
.commit();
You are supposed to store single key-value paired data with SharedPreferences. Trying to store big grouped data is not efficient at all. You should use an SQLite database.
SQLite and ContentProvider Tutorial
You can save to shared preference in this way
SharedPreferences sp = context.getSharedPreferences(
"file name", 0);
SharedPreferences.Editor spEdit = sp.edit();
spEdit.putLong(key, value);
spEdit.commit();