I finished the job as below:
ParseQuery<ParseRole> query = ParseRole.getQuery(); Intent intent = getActivity().getIntent(); String groupId = intent.getStringExtra("groupId"); query.whereEqualTo("objectId", groupId); groupUsers = new ArrayList<String>(); query.findInBackground(new FindCallback<ParseRole>() { @Override public void done(List<ParseRole> objects, ParseException e) { if(e == null) { for(ParseRole role : objects) { ParseRelation<ParseUser> usersRelation = role.getRelation("users"); ParseQuery<ParseUser> usersQuery = usersRelation.getQuery(); usersQuery.findInBackground(new FindCallback<ParseUser>() { @Override public void done(List<ParseUser> objects, ParseException e) { for(ParseUser user : objects) { groupUsers.add(user.getUsername()); } } }); } } else { Toast.makeText(getActivity(), "ERROR", Toast.LENGTH_SHORT).show(); } } });
I passed the group ID from Intent , which sent me to this Fragment , which I checked, and then populated my ListView list, which I returned from the query in the Parse database using the specific group ID. Hope this helps anyone who has had the same problem as me. Good luck
edwoollard
source share