Last active
November 12, 2016 15:15
-
-
Save jerryOkafor/0970cae55231e96d9b352ef474bded7b 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).startAt(300); | |
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