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.