Last active
November 12, 2016 15:17
-
-
Save jerryOkafor/342b02dd0813a91313f166a09f451289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class QuerySetByMembers{ | |
public void querySet(String memberId) | |
{ | |
Query queryByMember = FirebaseDatabase.getInstance().getReference().child("sets").orderByChild("members/"+memberId); | |
queryByMember.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
//Not that we are returning a list as our query is on sets | |
//so iterate through the datasnapshot and get the values | |
for (DataSnapshot data : dataSnapshot.getChildren()) | |
{ | |
Set set = data.getValue(Set.class); | |
} | |
} | |
@Override | |
public void onCancelled(DatabaseError databaseError) { | |
//handle some errors here | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment