I am trying to create an ArrayAdapter for a custom JSONArray.
I didn't find any tutorials I could use.
The app is getting data from WordPress. It is getting all the posts, the class gets filled, but I don't know how to display the class into a list.
It is declared as private Posts[] mPosts;
So the array of posts get's parsed into an array of Posts objects;
I have a List declared in my activity_main
, I have a row.xml
for the different objects. All that's left is the arrayadapter, which I can't seem to do.
I can post MainActivity and XML files, but the post will be too long.
Posts.class
public class Posts {
private String mId;
private String mDate;
private String mTitle;
private String mContent;
private String mCategories;
public String getId() {
return mId;
}
public void setId(String id) {
mId = id;
}
public String getDate() {
return mDate;
}
public void setDate(String date) {
mDate = date;
}
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
mTitle = title;
}
public String getContent() {
return mContent;
}
public void setContent(String content) {
mContent = content;
}
public String getCategories() {
return mCategories;
}
public void setCategories(String categories) {
mCategories = categories;
}