How I can save a Hash Map into the Shared Preferences in Android?
I would not recommend writing complex objects into SharedPreference. Instead I would use
ObjectOutputStream to write it to the internal memory.
File file = new File(getDir("data", MODE_PRIVATE), "map"); ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(file)); outputStream.writeObject(map); outputStream.flush(); outputStream.close();