New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayList goes empty after restarting app #8
Comments
Hi, |
I have same issue and I think same with #2 I'm using
|
Yes, it seems that there is an issue with collections. If you declare
then do
It will save, so simply modifying the collection seems to be insufficient to trigger a save |
This is expected behavior as mutable object change does not modify preferences. Use immutable objects. The same problem references all collections that have some persistence or internal structure depending on their state.
|
Hi,
i use below line to add product (data class) to cart in sharedpreference:
var CartItems: ArrayList<ResDataClass.Companion.Product> by bindToPreferenceField(arrayListOf())
when app is alive CartItems has values
but after restarting app CartItems goes Empty
everything except arraylist in sharedpreference has value
something's wrong in saving arrays in sharedpreference
plz fix it
thanks
The text was updated successfully, but these errors were encountered: