0

I have two classes "Offers" and "Stores". The Offer class has a pointer field called "storeId" which points back to the "Stores" class. I need to query offers of a specific category, belonging to stores within a 20km radius of my current location. The returned store objects should then be displayed in a list view.

This is my code in the onCreate() method of my ParseQueryAdapter subclass.

ParseQuery offersQuery = new ParseQuery("Offers");
offersQuery.whereEqualTo("category", category);
ParseQuery storesQuery = new ParseQuery("Stores");
storesQuery.whereWithinKilometers("location",myLoc,20);
storesQuery.whereMatchedKeyInQuery("objectId", "storeId", offersQuery);
return storesQuery

storesQuery is returning an empty list.

What am I missing? Also, please ignore ay typos in the above code

Thanks

Nakul
  • 1
  • 2
  • ParseQueryAdapter is pain in the ass. You better go off with using Your own RecyclerView and use list after `.findInBackround()` is done – jean d'arme Oct 03 '15 at 07:47
  • The reason behind ParseQueryAdapter is to reduce the number of queries pulled at once. If there is no way of implementing it for my purpose, I will be going with my own recyclerview :/ – Nakul Oct 04 '15 at 09:35

0 Answers0