1、存储list到sharedpreferences中是,可以采用如下方式:
String s1 = new Gson().toJson(list);
this.getSharedPreferences("key", 0).edit().putString("keyvalue", s1).commit();
2、从sharedpreferences中取list:
String s2= this.getSharedPreferences("key", 0).getString("keyvalue", defValue);
list=new Gson().from(new Typetoke<List<String>>{}.gettype());
3、字符串和josn之间的转换:
String s3="12345";
JsonObject json=new JsonObject(s3);
String s4=json.toString();
未完待续。。。。。。