This is what my test looks like:
I won\'t use the fields above, it\'s just a dummy. But I would like to go through all the children on \"users\" and for eac
Use Iterator to iterate through dataSnapshot
public void onDataChange(DataSnapshot snapshot) {
Iterator items = snapshot.getChildren().iterator();
int counter = 0;
while (items.hasNext()) {
DataSnapshot item = items.next();
Log.i("Result", "email" + item.child("email").getValue().toString());
Log.i("Result", "User ID" + item.child("userId").getValue().toString());
Log.i("Result", "User Name" + item.child("username").getValue().toString());
}
}
Iterator will iterate through all child elements of users and with items.next() you can access child of users's child