private final String LAW_HOLIDAYS_DATA_GSON = "law_holidays_data_gson";
private List<String> lawHolidays = new ArrayList<String>();
存储数据
Gson gson = new Gson();
String lawHolidaysData = gson.toJson(lawHolidays);
SharedPreferencesUtil.saveString(LAW_HOLIDAYS_DATA_GSON, lawHolidaysData);
读取数据
String lawHolidaysData = SharedPreferencesUtil.getString(LAW_HOLIDAYS_DATA_GSON);
Gson gson = new Gson();
Type listType = new TypeToken<List<String>>() {}.getType();
List<String> list = gson.fromJson(lawHolidaysData, listType);