Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Json problem
Message
General information
Forum:
Android
Category:
Other
Title:
Miscellaneous
Thread ID:
01629711
Message ID:
01629713
Views:
40
>Hi all, I'm trying to deserialize a Json string into a custom class
>
>
>public class Artist
>{
>    public Artist()
>    {
>        this.Albums = new ArrayList<Album>();
>    }
>
>    @SerializedName("artist")
>    String Artist;
>
>    @SerializedName("id")
>    String ID;
>
>    @Expose
>    ArrayList<Album> Albums = null;
>    
>
>    @Expose
>	String PlaceHolder = "";
>    }
>
>
>
>The problem I'm having is only the fields that are present in the Json string (id and artist ) are getting deserialized, what I want is for the other properties to be set to null which I will populate later. Any ideas ?

Not an answer to your question but if you are using this to retrieve data from a server you could take a look at Retrofit : http://square.github.io/retrofit/
Once set up it's simple to make async calls to the server and get back results already converted to Java objects (you can specify GSon as the converter)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform