Skip to content
Advertisement

Firebase for Android, How can I loop through a child (for each child = x do y)

This is what my test looks like:

enter image description here

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 each email return a:

JavaScript

The only way I found of listing an object is using firebaseAdapter, is there another way of doing it?

Advertisement

Answer

The easiest way is with a ValueEventListener.

JavaScript

The User class can be defined like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement