This is the string i receive is a validate json by jsonlint String decodedCookie = URLDecoder.decode(myCookie.getValue(), "UTF-8"); Gson g = new Gson();
here what that string look like
{
"urlAW": "http://www.google.com",
"urlApi": "http://www.google.com",
"lang": "en",
"infoComplete": "{\"id\":\"569\",\"status\":\"START\"}",
"isApp": false,
"isActive": false
}
Infos = g.fromJson(decodedCookie, Infos.class);
each time i try to parse it fail at infoComplete
given the error java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1
but InfoComplete.class only has 2 fields id and status with getter and setter
not sure what i am missing to make it work. Any help will be appreciate.
Infos class look like this
public class Infos {
private String urlAW;
private String urlApi;
private String lang;
private InfoComplete infoComplete;
private boolean isApp;
private boolean isActive;
public String getUrlAW() {
return urlAW;
}
public void setUrlAW(String urlAW) {
this.urlAW = urlAW;
}
public String getUrlApi() {
return urlApi;
}
public void setUrlApi(String urlApi) {
this.urlApi = urlApi;
}
public String getLang() {
return langue;
}
public void setLang(String lang) {
this.lang = lang;
}
public InfoComplete getInfoComplete() {
return infoComplete;
}
public void setInfoComplete(InfoComplete infoComplete) {
this.infoComplete = infoComplete;
}
public boolean isApp() {
return isApp;
}
public void setApp(boolean app) {
isApp = app;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean active) {
isActive = active;
}
@Override
public String toString() {
return "Infos{" +
"urlAW='" + urlAW + '\'' +
", urlApi='" + urlApi + '\'' +
", lang='" + lang + '\'' +
", infoComplete='" + infoComplete + '\'' +
", isApp=" + isApp +
", isActive=" + isActive +
'}';
}
}