This is my database in the firebase
{
"Rooms" : {
"room1" : {
"Header" : {
"Recipient" : "JZrMZeE6JXYULHRtDbksfagnQE53",
"Sender" : "fD0E2IbeGub53n1muYSYX88N6US2"
},
"Message" : {
"MESSAGE-QWEASD" : {
"Message" : "Hello World",
"Name" : "fD0E2IbeGub53n1muYSYX88N6US2"
}
}
}
}
}
When i see the guide of firebase's database, it always requires a specified location to access data. However, I want to access sub directory(room1) of the main directory(Rooms) without indicating its name. For now, I need to indicate the name to access the data inside its name of room.
dataSnapshot.child("Rooms").child("room1").getValue().toString()
Is there a method that returns a string of sub directory's name