I have this code:
Type typeOfObjectsList = new TypeToken>() {}.getType();
List objectsList = new Gson().fromJso
Fully working solution:
String json = .... //example: mPrefs.getString("list", "");
ArrayList myTypes = fromJSonList(json, YouClassName.class);
public ArrayList fromJSonList(String json, Class type) {
Gson gson = new Gson();
return gson.fromJson(json, TypeToken.getParameterized(ArrayList.class, type).getType());
}