Problems returning objects in Parse using android

0

I'm having trouble returning the objects using Parse to connect to heroku. When I search about returning objects, everyone tells me to use the following code:

ParseQuery query = new ParseQuery("Players");
query.whereEqualTo("status", "active");
query.orderByAscending("lastName"); // By lastname ascending order
query.findInBackground(new FindCallback() {
    @Override

  public void done(List<ParseObject> players, ParseException e) {

    if (players != null) {
      // Success - players contain active players

    } else {

      // Failed

                          } 

             }  

});

So that it returns a list of ParseObject and from there capture the information. But when I try to do this, Android Studio says it's wrong. When I hit alt + enter to see the solution, it gives me the solution to add the following implementations:

ParseAnalytics.trackAppOpenedInBackground(getIntent());

ParseQuery query = new ParseQuery("Players");
query.whereEqualTo("status", "active");
query.orderByAscending("lastName"); // By lastname ascending order
query.findInBackground(new FindCallback() {

@Override
  public void done(Object o, Throwable throwable) {

  }

  @Override
  public void done(List objects, ParseException e) {

  }

}

Can anyone tell me how to handle this or is it correct? I want to return all the users that are in a mongoDB collection that is in Heroku.

    
asked by anonymous 14.04.2018 / 21:45

1 answer

1

To update if someone else goes through this:

I was able to resolve this by adding "new FindCallback" < "ParseObject ()"> ( WITHOUT ASPTS ) instead of "new FindCallback ()" as demonstrated below. >

How I left and worked:

ParseQuery<ParseObject> query = ParseQuery.getQuery("_User");
    query.whereEqualTo("ID_Professor", capturaIDprofessor());
    query.findInBackground(new FindCallback<ParseObject>() {
        public void done(List<ParseObject> NomeAlunosList, ParseException {


    });
    
24.04.2018 / 22:48