I'm creating a chat app on android using Firebase Database and Java. Whenever the user is first registered, it stores their username into the database under the nodes user/UserID/profile/username. The username is stored using a User class. This is where the username value is stored. However when I try something like
mDatabase.child("users").child(UserID).child("profile").child("username").toString();
This gives me the path to the username but not the username itself. Does anybody know how to get the value of the username itself?
EDIT: It gives me an error when I run
DataSnapshot.child("users").child(mUserID).child("profile").child("username").getValue().toString();
Here is what my Firebase database shows under the UserID.
