I’m trying to figure out the best way to store an ArrayList<HashMap<String, String>> item so that it’s accessible across activities. In one activity, I store it like by adding a series of HashMap<String, String> items to the ArrayList.
How would I go about accessing this in another activity? I tried SharedPreferences, but it will only store it as a string, as far as I know. Any suggestions?
Edit: I’m storing XML in the HashMap in the form of of tag, value
Why don’t you use the application class for this? That way you can put the data structure there, and its info can be shared across activities. Just be aware that the application can be destroyed, and that keeping it in the application means that you’d have to save it in sharedprefs or write to disk if you want to keep it around permanently.