What I want to do is to get the number of the children using AddChildEventListener
as we can do using addListenerForSingleValueEvent
.
I mean
thisRoom.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
int numberOfPlayers = (int) dataSnapshot.getChildrenCount();
Now I can get thisRoom's children but I'm wondering if there's a way to do the same thing using AddChildEventListener
.