august alsina august alsina - 1 month ago 22
Android Question

Get child name from Firebase?

If I have something like:

child name: "value"


How can I get the childname? I know its possible to get the value, but what about the other?

Answer

Yes! The child name in this situation is the "KEY" of that value. So use the reference object and simple call getKey() on it.

String name = ref.getKey();
Comments