URI create bug ?
Hi when i save an object with URI, Hawk.put return true but the get does'nt work.
This is class
public class UserDataProfile {
public String displayName;
public String email;
public Uri photo;
public UserDataProfile(String displayName, String email, Uri photo) {
this.displayName= displayName;
this.email= email;
this.photo=photo;
}
}
UserDataProfile userDataProfile= new UserDataProfile(acct.getDisplayName(), acct.getEmail(), acct.getPhotoUrl()); boolean bPut= Hawk.put("userDataProfile", userDataProfile);
bPut is true.. but when i get data .. return a null obj
UserDataProfile userDataProfile= Hawk.get("userDataProfile");
userDataProfile is null
Hi, need to check this issue. thank for reporting
Hi, I'm facing the same issue, got the following exception when converting from string (DefaultHawkFacade.java line 110) :
java.lang.RuntimeException: Failed to invoke private android.net.Uri() with no args
👍 Will check this issue.
I also face this same problem. Hope could solve this soon. Thank you a lot
find a solution. Hope could help.
`` public final class GsonUriParser implements Parser {
private Gson gson;
public GsonUriParser() {
}
@Override public <T> T fromJson(String content, Type type) throws JsonSyntaxException {
if (TextUtils.isEmpty(content)) {
return null;
}
this.gson = new GsonBuilder()
.registerTypeAdapter(Uri.class, new UriDeserializer())
.create();
return gson.fromJson(content, type);
}
@Override public String toJson(Object body) {
this.gson = new GsonBuilder()
.registerTypeAdapter(Uri.class, new UriSerializer())
.create();
return gson.toJson(body);
}
}