This is my JSON data
{
"success": "1",
"results": [
{
"type": "1.popmusic",
"posts": [
{
"music": "1.AAA"
},
{
"music": "2.BBB"
}
]
}
]
}
I need to click some kind of music such as I click "popmusic" on my listview and then,Intent to new activity to show music in popmusic ,From my json It have to show "1.AAA" and "2.BBB" on listview.
I can't get "posts" from my json.How can I get it.
This is Blog1 Class
public class Blog1 {
String success;
List<Post> results;
public List<Post> getResults() {
return results;
}
}
This is Post1 class
public class Post1 {
String name;
public String getName() {
return name;
}
public String getAuthor() {
return author;
}
// Getter and Setter
This is main class
private void showData(String jsonString) {
Gson gson = new Gson();
Blog1 blog = gson.fromJson(jsonString, Blog1.class);
List<Post> results = blog.getResults();
mAdapter = new CustomAdapter1(this, results);
mListView.setAdapter(mAdapter);
}