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
Can't get List<Foo> from Hawk.get #61
Comments
Returns zero because of the "new" Hawk.get(Constant.PREF_FOO, new ArrayList()); <- This is wrong, because the proper way to get back your "foos" is this: List < Foo > foos = Hawk.get(Constant.PREF_FOO); Check the doc. |
Hawk.get(Constant.PREF_FOO, new ArrayList()); <- I need the default value. I think it's the |
hmm if i understand well you try to do something like this?
|
yep, i put the list which size is 2. |
I haven't tried yet but gson apparently can't serialize and deserialize everything due to immutability, I'll find another parse approach. I have the same problem with joda time. Work around could be to use transient keyword for Uri to avoid it being serialized/deserialized for now. |
In alternative to GSON i recommend Jackson |
I'll create another issue for different converters. I'm closing this issue. |
Hi there,
I defined a Class named Foo.
but
Hawk.get(Constant.PREF_FOO, new ArrayList<Foo>());
always return list which size is 0(default value).The text was updated successfully, but these errors were encountered: