title: Querying Firebase, Retrieving, And Passing To Adapter
body: <p>I'm trying to get values from firebase. Here, I'm not able to get the values inside the "attendance" node.</p>
  
  <p><a href="https://i.stack.imgur.com/GbjjS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GbjjS.png" alt="enter image description here"></a></p>
  
  <p>Here is my model:</p>
  
  <pre><code>public class MemberInGroup {
  
  private String name;
  private HashMap&lt;String, HashMap&lt;String, Object&gt;&gt; attendance;
  private String group;
  
  public MemberInGroup() {
  
  }
  
  public MemberInGroup(String name, HashMap&lt;String, HashMap&lt;String, Object&gt;&gt; attendance, String group) {
      this.name = name;
      this.attendance = attendance;
      this.group = group;
  }
  
  public String getName() {
      return name;
  }
  
  public String getGroup() {
      return group;
  }
  
  public HashMap&lt;String, HashMap&lt;String, Object&gt;&gt; getAttendance() {
      return attendance;
  }
  </code></pre>
  
  <p>Here is the populateView method in the adapter:</p>
  
  <pre><code>    @Override
  protected void populateView(View view, MemberInGroup member, int i) {
  
      final String name = member.getName();
      final String group = member.getGroup();
  
      // Create views and assign values
      final TextView nameTxtView = (TextView) view.findViewById(R.id.nameTxtView);
      nameTxtView.setText(name);
  
      HashMap&lt;String, HashMap&lt;String, Object&gt;&gt; attendance = member.getAttendance();
  
      if(attendance != null) {
          HashMap&lt;String, Object&gt;  todayAttendance = attendance.get(Utility.getTodayName());
          if(todayAttendance != null) {
  
              String date = (String) todayAttendance.get("date");
          } 
      }
  </code></pre>
  
  <p>I'm able to retrieve "name" and "group" values, but not the day hash map inside the "attendance". Utility.getTodayName gives the correct day name, but "date" returns null. </p>
  
  <p>Here is how I query the database and set the adapter:</p>
  
  <pre><code>                    final DatabaseReference ref = database.getReference();
  
                  Query query = ref.child("members")
                          .orderByChild("group")
                          .equalTo("group7");
  
                  // Set the adapter with groupMembersRef
                  MembersOfGroupAdapter mOfGroupAdapter = new MembersOfGroupAdapter(getActivity(), MemberInGroup.class,
                          R.layout.list_item_member_in_sport, query);
                  sportMembersListView.setAdapter(mOfGroupAdapter);
  </code></pre>
  
  <p>I'm trying to query all members who are in certain group. Any suggestion is appreciated.</p>