Convert JsonString to a custom java ArrayList
问题 My qestion is, how I can convert an saved Json Sting back to an custom ArrayList. This is how I save my ArrayList: public void saveLocList(ArrayList<LocItem> locList) { SharedPreferences.Editor e = returnPref.edit(); Gson gson = new Gson(); String json = gson.toJson(locList); e.putString(LOCLIST, json); e.commit(); } And now, when I restore the ArrayList (Json String) it doesn't work with this code: public ArrayList<LocItem> getLocList() { String json = returnPref.getString(LOCLIST, ""); Type