I have a HashMap<Integer, ArrayList<MyTeam>> where the class MyTeam is a POJO. There will be at most 5 items in each ArrayList object. Is it possible to save this kind of HashMap to SharedPreferences? If not, what is another alternative? I need this data to be saved when the app is closed and reloaded when it starts up.
I've looked at this answer but the Key and Value attributes are both String and my case is a bit more complicated than just String data types. Will this method still work? Is there a better way?