title: How to get a single child from firebase database
body: <p>I have checked high and low but all I see are people trying to to get all the children into lists and stuff. I just want to get a single child from the database.</p>
  <pre><code>
  {
    &quot;Haydn&quot; : {
      &quot;Users&quot; : {
        &quot;email&quot; : &quot;user@gmail.com&quot;,
        &quot;name&quot; : &quot;kofi&quot;
      }
    }
  }
  
  </code></pre>
  <p><strong>I want to get the name from the structure.</strong></p>
  <p>My code:</p>
  <pre><code>        rootNode = FirebaseDatabase.getInstance();
          reference = rootNode.getReference().child(&quot;Users&quot;);
  
          reference.addListenerForSingleValueEvent(
                  new ValueEventListener() {
                      @Override
                      public void onDataChange(@NonNull DataSnapshot snapshot) {
                          if(snapshot.exists()){
                              String displayName = (String) snapshot.child(&quot;Haydn&quot;).child(&quot;Users&quot;).child(&quot;name&quot;).getValue();
                              loggedInUserTextView.setText(displayName);
                          }
                      }
  
                      @Override
                      public void onCancelled(@NonNull DatabaseError error) {
  
                      }
                  }
  </code></pre>