NB: Current response you posted is wrong, corrected to follow (not same , its example)
{
"source": {
"id": "the-hindu",
"name": "The Hindu"
},
"author": "",
"title": "Questionable remedy: on the National Medical Commission Bill",
"description": "Key sections of the National Medical Commission Bill need a rethink",
"url": "http://www.thehindu.com/opinion/editorial/questionable-remedy/article22354009.ece",
"urlToImage": "http://www.thehindu.com/static/theme/default/base/img/og-image.jpg",
"publishedAt": null
}
Add Following POJO CLASS
POJO GET
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Get {
@SerializedName("source")
@Expose
private Source source;
@SerializedName("author")
@Expose
private String author;
@SerializedName("title")
@Expose
private String title;
@SerializedName("description")
@Expose
private String description;
@SerializedName("url")
@Expose
private String url;
@SerializedName("urlToImage")
@Expose
private String urlToImage;
@SerializedName("publishedAt")
@Expose
private Object publishedAt;
public Source getSource() {
return source;
}
public void setSource(Source source) {
this.source = source;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUrlToImage() {
return urlToImage;
}
public void setUrlToImage(String urlToImage) {
this.urlToImage = urlToImage;
}
public Object getPublishedAt() {
return publishedAt;
}
public void setPublishedAt(Object publishedAt) {
this.publishedAt = publishedAt;
}}
And Add Source POJO
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Source {
@SerializedName("id")
@Expose
private String id;
@SerializedName("name")
@Expose
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Then on function call, you can get Get.title
as title and Get.description
as the description.
Then you can pass description as intent.putString("description",Get.description)