Last active
November 12, 2016 15:15
-
-
Save jerryOkafor/bec0e0644ce5c3f2dfeb24db9cfff9a3 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 void querySet(String memberId) | |
{ | |
Query queryByMember = FirebaseDatabase.getInstance().getReference().child("sets").orderByChild("members/"+memberId).endAt(200); | |
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