Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy null value returns in json parsing in android?
    primarykey
    data
    text
    <p>This is my Json:</p> <pre><code>{ "feed": [ { "id": "124124124124", "source": "aaaaaa", "comment_count": 0, "link": "bbbbb", "created_time": "2012-05-30T15:57:05+0000", "message": "ccccc", "type": "dddd", "thumbnail": "eeeee" }, { "id": "35464423423412414", "source": "qweqddq", "comment_count": 0, "link": "adadasdwe", "created_time": "2012-05-30T15:52:21+0000", "message": "dadsadad", "type": "sfdcsdv", "thumbnail": "csdgfsd" }, { "name": "asdadqwff", "id": "73182372381", "source": "lajhdkbad", "comment_count": 0, "link": "adjkbxczckbj", "created_time": "2012-05-30T15:40:28+0000", "message": "awjasdjands", "type": "lalkdm", "thumbnail": "akmldsncj" } ] } </code></pre> <p>These are my java classes to use in parsing:</p> <pre><code>public class Feed { @SerializedName("feed") ArrayList&lt;FeedResult&gt; feed; public ArrayList&lt;FeedResult&gt; getFeed() { return feed; } public void setFeed(ArrayList&lt;FeedResult&gt; feed) { this.feed = feed; } } public class FeedResult { @SerializedName("id") String id; @SerializedName("created_time") String created_time; @SerializedName("message") String message; @SerializedName("thumbnail") String thumbnail; @SerializedName("comment_count") String comment_count; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getCreated_time() { return created_time; } public void setCreated_time(String created_time) { this.created_time = created_time; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getThumbnail() { return thumbnail; } public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail; } public String getComment_count() { return comment_count; } public void setComment_count(String comment_count) { this.comment_count = comment_count; } } </code></pre> <p>This is the inside of main class:</p> <pre><code>InputStream source = retrieveStream(url); Gson gson=new Gson(); Reader reader = new InputStreamReader(source); Feed feeds=gson.fromJson(reader,Feed.class); ArrayList&lt;FeedResult&gt;feed=new ArrayList&lt;FeedResult&gt;(); feed=feeds.getFeed(); Toast.makeText(this,"feed --&gt; ?? "+ feed, Toast.LENGTH_LONG).show(); </code></pre> <p><code>feeds.getFeed()</code> returns null. Why is that? thanks for your help already.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload