title: Firebase - Retrieve User Information from Database
body: <p><a href="https://i.stack.imgur.com/Mjiov.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mjiov.png" alt="enter image description here"></a>> I have 3 classes.</p>
  
  <ul>
  <li><code>DriverDatabase.class</code></li>
  <li><code>AddInfoDriver.class</code></li>
  <li><code>DriverProfile.class</code></li>
  </ul>
  
  <p>In <code>DriverDatabase.class</code> I have set(fName, lName .... and other fields.). Also, put <code>{get; and set;}</code> for those attribtues.</p>
  
  <p>In <code>AddInfoDriver.class</code> I have referenced <code>FirebaseDatabase</code> and <code>DriverDatabase.class</code> so that, whenever a user fills those edittexts, it saves to Firebase Database. </p>
  
  <p><strong>The Problem is:</strong> I cannot retrieve those 5 Edittext values in <code>DriverProfile.class</code>  below is the piece of code for retrieving.</p>
  
  <pre><code>public class DriverProfile extends Fragment {
  
  @BindView(R.id.btn_save) Button btnsave;
  @BindView(R.id.edtx_DoB) EditText edtxdob;
  @BindView(R.id.edtx_fname) EditText edtx_fname;
  @BindView(R.id.edtx_lname) EditText edtx_lname;
  @BindView(R.id.spinner_type) Spinner spn_type;
  @BindView(R.id.edtx_number) EditText edtx_number;
  
  private DatabaseReference driverfname, driverlname;
  
  
  public DriverProfile() {
  //Constructed is required
  
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
  
      View view = inflater.inflate(R.layout.fragment_my_profile, container, false);
      ButterKnife.bind(this, view);
  
      driverfname = FirebaseDatabase.getInstance().getReference().child("Drivers").child("fname");
      driverlname  = FirebaseDatabase.getInstance().getReference().child("Drivers").child("lname");
  
      driverfname.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              edtx_fname.setText(dataSnapshot.getValue(String.class));
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  </code></pre>
  
  <p>Didnt write all edittext codes, just see my <code>ValueEventListener</code> for fname of Driver. it is not displaying data when saved by driver in a <code>child("Drivers")</code></p>