Fetch data and display in ListView Parse.com

I am trying to pull a string "newStatus" on parse.com and display it in a list view called Post Status. I am already able to save a "newStatus" string from my app.

here is parse database

Now, when text is input and "posted" on my app, it refreshes the post page, where I have a "listview" implemented, and after refreshing, I want it to display all the "newStatus" strings in the list view.

I will post code if needed.

Upvotes: 0

Views: 84

Answers (1)

ahbou
ahbou

Reputation: 4928

You have two options:

  • Either fetch the updated PFObject from Parse
  • Or when the post to parse succeeded update you listview data source

Option 1 would look like :

ParseQuery<ParseObject> query = ParseQuery.getQuery("Status");
query.getInBackground("xWMyZ4YEGZ", new GetCallback<ParseObject>() {
  public void done(ParseObject object, ParseException e) {
   if (e == null) {
  // object
      String status = object.getString("newStatus");
   } else {
  // error
  }
 }
});

Upvotes: 1

Related Questions