title: Retrieving data from Firebase database is returning null values
body: <p>I have created a database in Firebase with rules as follows:</p>
  
  <pre><code>{
    "rules": {
      ".read": true,
      ".write": true
    }
  }
  </code></pre>
  
  <p>And my database is shown in the form of JSON data like this:</p>
  
  <pre><code>fieldglass-aeca7
   0 
     age: 23
     name:"shikher"
   1
    age:24
    name:"samarth"
  
  fieldglass-aeca7
    -KWm_3CF1pSVtuy9nhFF
        age:12
        name:"shikhermishra"
    -KWmaVs4frXpS_1lVhcj
        age:13
        name: "Shiker"
  </code></pre>
  
  <p>Now I have written a code to read the data from the database. And also a class User which has 2 data members age,name.</p>
  
  <p>User class is as follows:</p>
  
  <pre><code>import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.database.ValueEventListener;
  
  
  
  
  public class User {
  
  public int age;
   public String name;
  
   public User(){
   }
   public User(int age,String name)
   {
    this.name=name;
    this.age=age;
   }
  
   public void setAge(int age) {
    this.age = age;
   }
  
   public void setName(String name) {
    this.name = name;
   }
  
  
   public int getAge() {
    return age;
   }
  
   public String getName() {
    return name;
   }
  }
  </code></pre>
  
  <p>And my database fetching code is like:</p>
  
  <pre><code>FirebaseDatabase database=FirebaseDatabase.getInstance();
          DatabaseReference reference=database.getReference("fieldglass-aeca7");
  
          reference.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  User user=dataSnapshot.getValue(User.class);
                  Log.d("user info---@@*******",String.valueOf(user.getAge()));
  
  
  
                  assert tv != null;
                  assert tv1 != null;
                  tv.setText(String.valueOf(user.age));
                  tv1.setText(user.name);
  
  
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
                  Log.d("The read failed",databaseError.getDetails());
              }
          });
  </code></pre>
  
  <p>I am trying to fetch the age and name and display it on the 2 <code>TextView</code>s I have.</p>
  
  <p>But the output I am getting is </p>
  
  <pre><code>user.age=0 and user.name=null.
  </code></pre>
  
  <p>I want to fetch all the data which is present inside :</p>
  
  <pre><code>fieldglass-aeca7
  ......
  
     fieldglass-aeca7
  </code></pre>
  
  <p>this key value.</p>
  
  <p>I want all the data inside the above path shown. How can I get it?</p>