0

I am building an app that will be able to let you answer assessment questions. Now I have a problem on how to save the scores to the current user. I cannot access the child node. This is the real time database. How can I access the child node under Users

Realtime Database

KENdi
  • 7,576
  • 2
  • 16
  • 31

1 Answers1

0

You can simply use for loop to access the users just write this code under addOnEventListener:

DataSnapshot Users = datasnapshot.child("Users");
for(DataSnapshot userChild : Users.getChildren()){
    DataSnapshot email = userChild.child("email");
    String emailString = email.getValue(String.class);
}
Pratham Khurana
  • 141
  • 1
  • 12