title: Parse Android get Users List
body: <p>I have this function in my App for making a leaderboard. When executing, it never goes reaches the for loop and I'm unable to update my leaderboard. Is there any better implementation for the same?</p>
  
  <pre><code>public void updateLeaderboard(final Context context) {
          Log.d("Leaderboard ", "Updating");
          ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery(KEY_USER_CLASS);
          query.addDescendingOrder(KEY_LAST_LEVEL);
          query.addAscendingOrder(KEY_CROSSED_AT);
          query.whereNotEqualTo(KEY_ADMIN, true);
          query.whereEqualTo(KEY_EMAIL_VERFIFIED, true);
          query.findInBackground(new FindCallback&lt;ParseObject&gt;() {
  
              @Override
              public void done(List&lt;ParseObject&gt; users, ParseException e) {
                  Log.d("Leaderboard ", "done() caled");
                  if (e == null) {
                      Log.d("Leaderboard ", "inside if");
  
                      for (int i = 0; i &lt; users.size(); i++) {
                          ParseObject user = users.get(i);
                          Log.d("Leaderboard ",
                                  "Updating user " + String.valueOf(i + 1));
                          user.put(KEY_RANK, i + 1);
                          user.saveInBackground(new SaveCallback() {
  
                              @Override
                              public void done(ParseException e) {
                                  if (e == null) {
                                      Log.d("Leader", "Saved");
                                  } else {
                                      Toast.makeText(context, e.getMessage(),
                                              Toast.LENGTH_SHORT).show();
                                  }
  
                              }
                          });
                      }
  
                  } else {
                      Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT)
                              .show();
                  }
              }
          });
  
          Log.d("Leaderboard ", "Closing");
      }
  </code></pre>