use of com.ushahidi.java.sdk.api.CommentFields in project Ushahidi_Android by ushahidi.
the class UploadComments method addComments.
private int addComments(Bundle bundle) {
CommentFields comment = new CommentFields();
CommentsApi commentApi = new CommentsApi();
if (bundle != null) {
Comment c = new Comment();
c.setAuthor(bundle.getString("comment_author"));
c.setDescription(bundle.getString("comment_description"));
c.setReportId(bundle.getInt("report_id"));
comment.fill(c);
comment.setEmail(bundle.getString("comment_email"));
Response response = commentApi.submit(comment);
if (response != null) {
if (response.getErrorCode() == 0) {
commentApi.saveComments(bundle.getInt("report_id"));
}
}
}
return 1;
}
Aggregations