Open luchfilip opened 8 years ago
Why did you want to store LinearLayout
or any View
?
I had an array of objects that I use, and in order to test a little feature I've put the view inside the object while not considering that this object is used by prefser. Then when debugging I found where exactly this loop happens.
The intention of prefser is storing simple data structures - not complicated objects or views. In my opinion, storing views doesn't make sense. If you want to remember a specific state of the UI, you should extract part of your code into a simpler class and then store its instance. I'm not surprised that it didn't work. It's incorrect usage of the library. You can provide StackTrace and we can eventually improve error handling or data validation, but we won't handle storing objects from Android SDK or anything like that.
I did not even intent to suggest that this library should store such data types; it was more about being aware this is happening and maybe you would like to handle the error in a more elegant way.
Can you provide StackTrace of your error? Then it will be easier to handle it.
While I know the types of data Prefser can store, I've tried to store a
LinearLayout
data type. The app hangs and does an infinite loop insideGson.java
on line 358:Also the app crashes on storing
View
.Model: Nexus 5, android 6.0.1