I have problem with nested query. In query5.whereEqualTo("piwo", followList2.get(0))
I want to get the object, but it spits error that followList2 needs to be declared final, but when it does all the anonymous class gets in red with Cannot resolve constructor(...)
error. Anyone got this before?
ParseQuery<ParseObject> query3 = ParseQuery.getQuery("Piwo");
query3.whereEqualTo("marka", beer); // TODO if(beer == "all") then don't use it
query3.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> followList2, ParseException e) {
if (followList2 != null) {
Log.d("ASD", "Szukane piwo: " + followList2.get(0).getString("marka"));
} else {
Log.d("ASD", "Zero wyników1");
}
ParseQueryAdapter<ParseObject> adapter =
new ParseQueryAdapter<ParseObject>(this, new ParseQueryAdapter.QueryFactory<ParseObject>() {
public ParseQuery<ParseObject> create() {
// Here we can configure a ParseQuery to our heart's desire.
ParseQuery query5 = new ParseQuery("Cena");
query5.whereContainedIn("lokal", list);
query5.whereEqualTo("piwo", followList2.get(0);
query5.include("piwo");
query5.include("lokal");
query5.orderByAscending("cena");
return query5;
}
});
adapter.setTextKey("lokal.place");
adapter.setImageKey("photo");
ListView listView = (ListView) findViewById(R.id.listview);
listView.setAdapter(adapter);