title: ExpandableListAdapter methods are not working properly in my case. Any alternate to ExpandableListView
body: <p>I am using an <code>ExpandableListAdapter</code> for the first time. I have some textviews in the groupView and some buttons in childView. I've used the following code from the internet and tried to convert it according to my preference. But there is a problem in the <code>getGroupCount()</code> method. I know in my code <code>_listDataHeader</code> and <code>_listDataChild</code> are null, but what should I use instead? Here are the pictures of my header view</p>
  
  <p><a href="https://i.stack.imgur.com/8ZG7x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ZG7x.png" alt="header View layout"></a>   </p>
  
  <pre><code>  and Child View layout
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xITo0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xITo0.png" alt="child view layout"></a>.</p>
  
  <p>On the click of header this child View should be shown on screen.. Am i using the correct android View for this design? Please help</p>
  
  <pre><code> public class ExpandableListAdapter extends BaseExpandableListAdapter {
  
  Activity context;
  ArrayList&lt;String&gt; s_date,c_number,d_ration,s_time,download_path,a_number,a_name;
  String id[];
  String mUrl;
  
  private List&lt;String&gt; _listDataHeader; // header titles
  // child data in format of header title, child title
  private HashMap&lt;String, List&lt;String&gt;&gt; _listDataChild;
  
  public ExpandableListAdapter(Activity context, ArrayList&lt;String&gt; start_date, ArrayList&lt;String&gt; caller_number, ArrayList&lt;String&gt; duration,ArrayList&lt;String&gt; start_time, ArrayList&lt;String&gt; download_path, ArrayList&lt;String&gt; agent_number, ArrayList&lt;String&gt; agent_name) {
      this.context=context;
      this.s_date=start_date;
      this.c_number=caller_number;
      this.d_ration=duration;
      this.s_time=start_time;
      this.download_path=download_path;
      this.a_number=agent_number;
      this.a_name=agent_name;
  }
  
  @Override
  public Object getChild(int groupPosition, int childPosititon) {
      return this._listDataChild.get(this._listDataHeader.get(groupPosition))
              .get(childPosititon);
  }
  
  @Override
  public long getChildId(int groupPosition, int childPosition) {
      return childPosition;
  }
  
  @Override
  public View getChildView(final int groupPosition, final int childPosition,
                           boolean isLastChild, View convertView, ViewGroup parent) {
  
      final String childText = (String) getChild(groupPosition, childPosition);
  
      if (convertView == null) {
          LayoutInflater infalInflater = (LayoutInflater) this.context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = infalInflater.inflate(R.layout.list_item, null);
      }
  
      Button play_button=(Button) convertView.findViewById(R.id.play);
      play_button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
              Log.d("play child is",childText);
  
          }
      });
  
      Button download_button=(Button) convertView.findViewById(R.id.download);
      download_button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
              Log.d("download child is",childText);
  
          }
      });
  
  }
  
  @Override
  public int getChildrenCount(int groupPosition) {
      return this._listDataChild.get(this._listDataHeader.get(groupPosition))
              .size();
  }
  
  @Override
  public Object getGroup(int groupPosition) {
      return this._listDataHeader.get(groupPosition);
  }
  
  @Override
  public int getGroupCount() {
      return this.s_date.size();
  }
  
  @Override
  public long getGroupId(int groupPosition) {
      return groupPosition;
  }
  
  @Override
  public View getGroupView(int groupPosition, boolean isExpanded,
                           View convertView, ViewGroup parent) {
      String headerTitle = (String) getGroup(groupPosition);
      if (convertView == null) {
          LayoutInflater infalInflater = (LayoutInflater) this.context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = infalInflater.inflate(R.layout.list_group, null);
      }
  
      TextView start_date = (TextView) convertView.findViewById(R.id.start_date);
      start_date.setText(s_date.get(groupPosition));
      TextView caller_number = (TextView) convertView.findViewById(R.id.caller_number);
      caller_number.setText(c_number.get(groupPosition));
      TextView duration = (TextView) convertView.findViewById(R.id.duration);
      duration.setText(d_ration.get(groupPosition));
      TextView start_time = (TextView) convertView.findViewById(R.id.start_time);
      start_time.setText(s_time.get(groupPosition));
      TextView agent_name = (TextView) convertView.findViewById(R.id.agent_name);
      agent_name.setText(a_name.get(groupPosition));
      TextView agent_number = (TextView) convertView.findViewById(R.id.agent_number);
      agent_number.setText(a_number.get(groupPosition));
     // start_date.setTypeface(null, Typeface.BOLD);
     // start_date.setText(headerTitle);
  
      return convertView;
  }
  
  
  @Override
  public boolean hasStableIds() {
      return false;
  }
  
  @Override
  public boolean isChildSelectable(int groupPosition, int childPosition) {
      return true;
  }
   }
  </code></pre>
  
  <p>and this is how i'm setting the adpater</p>
  
  <pre><code>     ExpandableListAdapter a=new ExpandableListAdapter(MainScreen.this,start_date,caller_number,duration,start_time,download_path,agent_number,agent_name);
      data_list.setAdapter(a);
  </code></pre>