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 he returns a list of Parseobject and from there capture the information. However, when I try to do this Android Studio says it’s wrong. When I press 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 treat this or if it is correct? I wish to return all users who are in a collection in mongoDB that is in Heroku.