title: How Can I get ArrayList of Java Objects of all Childs from Firebase
body: <p>How Can I get ArrayList of Java Objects of all Childs from Firebase using updated firebase commands, currently I am using below approach but not able to get the list.</p>
  
  <pre><code>ValueEventListener postListener = new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  // Get Post object and use the values to update the UI
  
                  if(dataSnapshot!=null){
                      for (DataSnapshot postSnapshot:        dataSnapshot.getChildren()) {
                          UserDataClass post =    postSnapshot.getValue(UserDataClass.class);
                          members.add(post);
                      }
  
                  }
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
                  // Getting Post failed, log a message
  
              }
          };
          mDatabaseRef.addValueEventListener(postListener);
  </code></pre>
  
  <blockquote>
    <p>below is datasnapshot which is returning from firebase but I am not able to get the desired result out of it.</p>
  </blockquote>
  
  <pre><code>DataSnapshot { key = 12345, value = {Members={00000000={phoneNo=00000000, longitude=73.0703307, latitude=33.6396975, password=qwertyuiop, CName=00000000, admin=true, name=Anwar Kamal}, 03028084374={phoneNo=03028084374, longitude=73.0701292, latitude=33.6397129, password=qwerty, CName=00000000, admin=false, name=Nehal Khan}, 03028084516={phoneNo=03028084516, longitude=73.0702659, latitude=33.6397622, password=qwerty, CName=03035356317, admin=false, name=Jamal Khan}}} }
  </code></pre>
  
  <blockquote>
    <p>all i want is list of all members</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/kryc2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kryc2.png" alt="FireBase Database Structure"></a></p>
  
  <blockquote>
    <p>and my java object is </p>
  </blockquote>
  
  <pre><code>public class UserDataClass {
       public double latitude;
       public double longitude;
       public String Name="";
       public String password="";
       public String phoneNo="";
       public String CircleName="";
       public boolean isAdmin=false;
  }
  </code></pre>