title: Retrieving specific data from Firebase Database
body: <p>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 <code>user/UserID/profile/username</code>. The username is stored using a User class. This is where the username value is stored. However when I try something like </p>
  
  <pre><code>mDatabase.child("users").child(UserID).child("profile").child("username").toString();
  </code></pre>
  
  <p>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?</p>
  
  <p>EDIT: It gives me an error when I run </p>
  
  <pre><code>DataSnapshot.child("users").child(mUserID).child("profile").child("username").getValue().toString();
  </code></pre>
  
  <p>Here is what my Firebase database shows under the UserID.</p>
  
  <p><img src="https://i.stack.imgur.com/omYzI.png" alt="Firebase database profile"></p>