title: Different Child Layouts for different groups ExpandableListView
body: <p>I've been having issues trying to do this. I can't seem to get it right, I want to control each parent + children of that parent. ExpandableListView has been giving me a headache.
  package comments;</p>
  
  <pre><code>public class CommentsExpandableListAdapter extends BaseExpandableListAdapter {
  
  private Activity context;
  private Map&lt;String, List&lt;String&gt;&gt; comments_feed_collection;
  private List&lt;String&gt; group_list;
  
  
  
  private boolean a_comment = false;
  public CommentsExpandableListAdapter(Activity context, List&lt;String&gt; group_list,
                               Map&lt;String, List&lt;String&gt;&gt; comments_feed_collection) {
      this.context = context;
      this.comments_feed_collection = comments_feed_collection;
      this.group_list = group_list;
  }
  
  
  public Object getChild(int groupPosition, int childPosition) {
      return comments_feed_collection.get(group_list.get(groupPosition)).get(childPosition);
  }
  
  public long getChildId(int groupPosition, int childPosition) {
      return childPosition;
  }
  
  public View getChildView(final int groupPosition, final int childPosition,
                           boolean isLastChild, View convertView, ViewGroup parent) {
      final String incoming_text = (String) getChild(groupPosition, childPosition);
      LayoutInflater inflater = context.getLayoutInflater();
  
  
      if (convertView == null) {
          //first view
          if(childPosition==0 &amp;&amp; groupPosition==0) {
              convertView = inflater.inflate(R.layout.description_of_ads_expandable_list, null);
              TextView description_child = (TextView) convertView.findViewById(R.id.description_of_ads_expandable_list_child_text_view);
              description_child.setText(incoming_text);
          }else if(childPosition==0 &amp;&amp; groupPosition==1){
              //second view view
              convertView = inflater.inflate(R.layout.comments_create_comment, null);
          }else if(childPosition&gt;=1 &amp;&amp; groupPosition&gt;=1){
              //thrid view
              convertView = inflater.inflate(R.layout.comments_expandable_list_child, null);
          }
      }
      return convertView;
  }
  
  public int getChildrenCount(int groupPosition) {
      return comments_feed_collection.get(group_list.get(groupPosition)).size();
  }
  
  public Object getGroup(int groupPosition) {
      return group_list.get(groupPosition);
  }
  public int getGroupCount() {
      return group_list.size();
  }
  
  public long getGroupId(int groupPosition) {
      return groupPosition;
  }
  
  
  public View getGroupView(int groupPosition, boolean isExpanded,
                           View convertView, ViewGroup parent) {
      String incoming_text = (String) getGroup(groupPosition);
      if (convertView == null) {
          LayoutInflater infalInflater = (LayoutInflater) context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = infalInflater.inflate(R.layout.expandable_list_single_item,
                  null);
      }
      TextView item = (TextView) convertView.findViewById(R.id.expandable_list_single_item_text_view_group);
      item.setTypeface(null, Typeface.BOLD);
      item.setText(incoming_text);
      return convertView;
  }
  
  
  public boolean hasStableIds() {
      return true;
  }
  
  
  public boolean isChildSelectable(int groupPosition, int childPosition) {
      return true;
  }
  
  
  @Override
  public int getChildTypeCount() {
      return 3;
  }
  
  @Override
  public int getGroupType(int groupPosition) {
      return super.getGroupType(groupPosition);
  }
  
  @Override
  public int getGroupTypeCount() {
      return 3;
  }
  }
  </code></pre>