Updates API to read descriptions

This commit is contained in:
stom79 2017-10-27 10:51:00 +02:00
parent ddc1647313
commit d320d54416
2 changed files with 14 additions and 0 deletions

View File

@ -1694,6 +1694,9 @@ public class API {
attachment.setId(resobj.get("id").toString());
attachment.setType(resobj.get("type").toString());
attachment.setUrl(resobj.get("url").toString());
try {
attachment.setDescription(resobj.get("description").toString());
}catch (JSONException ignore){}
try{
attachment.setRemote_url(resobj.get("remote_url").toString());
}catch (JSONException ignore){}

View File

@ -30,6 +30,7 @@ public class Attachment implements Parcelable {
private String remote_url;
private String preview_url;
private String text_url;
private String description;
public Attachment(Parcel in) {
id = in.readString();
@ -38,6 +39,7 @@ public class Attachment implements Parcelable {
remote_url = in.readString();
preview_url = in.readString();
text_url = in.readString();
description = in.readString();
}
public static final Creator<Attachment> CREATOR = new Creator<Attachment>() {
@ -117,5 +119,14 @@ public class Attachment implements Parcelable {
dest.writeString(remote_url);
dest.writeString(preview_url);
dest.writeString(text_url);
dest.writeString(description);
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}