Skip to content

Instantly share code, notes, and snippets.

@musart
Last active January 1, 2016 23:39
Show Gist options
  • Save musart/8217705 to your computer and use it in GitHub Desktop.
Save musart/8217705 to your computer and use it in GitHub Desktop.
public void getData(String data) {
ParseQuery<ParseObject> query = ParseQuery.getQuery("myData");
query.whereEqualTo("myColumn", data);
// Retrieve the most recent ones
query.orderByDescending("createdAt");
// Only retrieve the last ten
query.setLimit(10);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> commentList, ParseException e) {
for (ParseObject comment : commentList) {
// This does not require a network access.
Log.d("post", "retrieved a related post" + comment.getObjectId());
Log.d("post", "retrieved a related post" + comment.getString("myColumn"));
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment