I have created a HashMap in the following way:
HashMap
I need this to rem
There is no support for any HashMap in SharedPreferences. You can treat a whole SharedPreferences as being a bit like a HashMap, but it is not a HashMap, and you cannot store a HashMap in an individual preference.
You are welcome to convert your HashMap into a String that could be stored in a SharedPreferences value, such as by converting it into JSON.