1

I have two ParseObjects: Trip and Schedule. Trip has an "assignedSchedule" column which points to a Schedule ParseObject. I get all rows of Trip and display them as a listview:

ParseQuery<ParseObject> trip = ParseQuery.getQuery("Trip");
trip.include("assignedSchedule");
trip.findInBackground(new FindCallback<ParseObject>() {
  public void done(List<ParseObject> list, ParseException e) {
    if (e == null) {
     ListView lv = (ListView) rootView.findViewById(R.id.schedule);
     SampleCustomAdapter adapter = new SampleCustomAdapter(list);
     lv.setTextFilterEnabled(true);
     lv.setAdapter(adapter2);

So, my custom adapter takes in an arrayList of Trip and display them as views. I need the "day" and "time" which are columns of Schedule. How do I get them? I keep finding:

   var day = result[i].get("assignedSchedule").get("day");

or something similar as the solution but this is for javascript. It doesn't seem to work on android. I do this:

ParseObject schedule = list.get(index);
schedule.get("assignedSchedule").get("day");

By the second .get, it says that it cannot resolve the method. I tried turning it into an array instead of an arrayList, tried to instantiate it as an Object instead of a ParseObject but it still gets the same error

Any suggestions would be awesome!

1 Answer 1

1

You can Schedule object as :

ParseObject schedule = (Schedule)(list.get(position).getParseObject("assignedSchedule"));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.