0

I have been working this issue for almost a month and can't find an answer. I have a ParseRelation called "shulMinyans" that I saved in a ParseObject named "Shul". I checked on the web that the ParseRelation saved properly and it saved fine. When I try to retrieve the object, the relation is showing that there are no known objects in the ParseRelation. All the other data for the ParseObject downloads fine except for the ParseRelation. Here is my code:

    ParseUser userToSync = ParseUser.getCurrentUser();
    Shul shulForID = (Shul) userToSync.get("shul");
    String shulID = shulForID.getObjectId();
    ParseQuery<Shul> shulQuery = ParseQuery.getQuery("Shul");
    shulQuery.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ONLY);
    ArrayList<Minyan> oneArray = null;
    try {
        Shul shulToLoad = shulQuery.get(shulID);
        shulToLoad.loadShul(userToSync);
        ParseRelation shulMinyans = shulToLoad.getRelation("shulMinyans");
        ParseQuery query = shulMinyans.getQuery();
        try {
            oneArray = (ArrayList<Minyan>) query.find();
        } catch (ParseException e) {
            e.printStackTrace();
        }
    } catch (ParseException e) {
        e.printStackTrace();
    }

How do I make the ParseRelation retrieve the data I have stored?

Manuel
  • 14,274
  • 6
  • 57
  • 130
Rich G
  • 36
  • 5
  • Some additional info - the same function works just fine in the iOS version of the app, only the Android version having problems. – Rich G Aug 31 '15 at 21:13

1 Answers1

0

Can you give this a try?

    ParseObject parseShul = ParseObject.createWithoutData("Shul", shulId);
    ParseRelation<ParseObject> relation = parseShul.getRelation("shulMinyans");
    ParseQuery<ParseObject> query = relation.getQuery();
    query.findInBackground(new FindCallback<ParseObject>() {
        @Override
        public void done(List<ParseObject> list, ParseException e) {
            // Do something here
        }
    });
Mark Pazon
  • 6,167
  • 2
  • 34
  • 50