Android: Converting ArrayList to GSON runs out of memory
问题 Hoping someone out there can explain this to me. I keep running out of memory when trying to store an ArrayList in my SharedPreferences . public void setCurrentAlarmList(ArrayList<CurrentAlarm> currentAlarms) { Log.e("SETTING LIST", "!!!"); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); SharedPreferences.Editor editor = prefs.edit(); Gson gson = new Gson(); String json = gson.toJson(currentAlarms); editor.putString(Constants.ALARM_LIST, json); editor.apply(