Refer to Users/Driver
and loop through children, you will get your key:
DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child("Driver");
ValueEventListener listener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
//loop through the children
for(DataSnapshot ds: dataSnapshot.getChildren()){
//get the key or keys depending on how many keys
String underLinedKey = ds.getKey();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
//log error
Log.w(TAG, "loadPost:onCancelled", databaseError.toException());
}
};
mDatabase.addValueEventListener(listener);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.