title: Retrieve information from Firebase
body: <p>Here's my database on Firebase:</p>
  
  <p><img src="https://i.stack.imgur.com/Gw7xM.png" alt="Here&#39;s my database on Firebase"></p>
  
  <p>I want to get the user's name after someone has just logged into my app.</p>
  
  <pre><code>final FirebaseDatabase database = FirebaseDatabase.getInstance();
  DatabaseReference ref = database.getReference("hellodoctor-65e79/message/user-doctor");
  
  FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
  
      ref = ref.child(user.getUid());
  
      ref.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              userDoctor[0] = dataSnapshot.getValue(UserDoctor.class);
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  </code></pre>
  
  <p>But it doesn't work, please help me, thanks in advance for your help.</p>