title: Firebase retrieve information once user is logged in
body: <p>I have the following database and need some help retrieving the name and address from the user which is logged in currently. 
  <a href="https://i.stack.imgur.com/jQpPm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jQpPm.jpg" alt="enter image description here"></a></p>
  
  <p>I wrote the following code but the information is not showing in the textview</p>
  
  <pre><code>public class UserProfileActivity extends AppCompatActivity {
  
      DatabaseReference userReference = FirebaseDatabase.getInstance().getReference();
  
      TextView userName;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_user_profile);
  
          userName = (TextView) findViewById(R.id.userName);
  
          ValueEventListener eventListener = new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  for (DataSnapshot ds : dataSnapshot.getChildren()) {
                      String name = ds.child("name").getValue(String.class);
                      userName.setText(name);
                  }
              }
  
              @Override
              public void onCancelled(FirebaseError firebaseError) {
  
              }
          };
      }
  }
  </code></pre>
  
  <p>This is what is currently happening when implementing the ValueEventListener
  <a href="https://i.stack.imgur.com/UBN6R.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UBN6R.jpg" alt="enter image description here"></a></p>