I want to save an object(of type MyObject) in Shared Preference via gson:
PS: store and retrieve a class object in shared preference
So 1 of the fields in MyObject is an ImageView which is fetched from a url.
Now when I do:
String json = gson.toJson(myObject);
I get a stackoverflow error. When I comment out the ImageView from my MyObject POJO this error gets resolved.
Q1- There are barely 8-10 images. So how do I store them through gson??
Q2- And is it a good practise to store images through gson, if not so then what better option do I have?
I think the error comes due to converting ImageView to string.