I want to apply query in firebase as "Those Students Who Are Having More Marks Then 70 in tenthP as well as in twelveP" and then show list of their names in list view.
This is I am using query in one child :
DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
Query query = reference.child("users").orderByChild("tenth").startAt("70").endAt("100");
query.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
Toast.makeText(FilterStudentsActivity.this,"Yes Exist",Toast.LENGTH_LONG).show();
// dataSnapshot is the "issue" node with all children with id 0
for (DataSnapshot issue : dataSnapshot.getChildren()) {
}
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});