I 've tried and googled alot to get all usernames from parse.com. the following code works for other tables but when I try this on the Parse.Users table it doesn't work.
ParseQuery<ParseObject> query = new ParseQuery<ParseObject>("User");
try {
    List<ParseObject> usersList = query.find();
    data = new String[usersList.size()+1];
    for (int i = 0; i < usersList.size(); i++) {
        data[i] = usersList.get(i).getString("username");
    }
plz tell me the right way to fetch all users
There's a special query to users class.
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereEqualTo("gender", "female");
query.findInBackground(new FindCallback<ParseUser>() {
  public void done(List<ParseUser> objects, ParseException e) {
    if (e == null) {
        // The query was successful.
    } else {
        // Something went wrong.
    }
  }
});
You can find more information on the android guide at parse documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With