title: How to implement multilevel expandable list view with single adapter?
body: <p>This is my expandlable list adapter call </p>
  
  <pre><code>TableOfContentsAdapter adapter = new    TableOfContentsAdapter(TableOfContentsActivity.this,toCList);
  mExpandableListViewTOC.setAdapter(adapter);
  </code></pre>
  
  <p>And this is my adapter implementation </p>
  
  <pre><code>class TableOfContentsAdapter extends BaseExpandableListAdapter {
  
  private Context context;
  private List&lt;TOCLink&gt; tocLinks;
  
  public TableOfContentsAdapter(Context context, List&lt;TOCLink&gt; tocLinks) {
      this.context = context;
      this.tocLinks = tocLinks;
  }
  
  @Override
  public int getChildrenCount(int groupPosition) {
      return tocLinks.get(groupPosition).getTocLinks().size();
  }
  
  @Override
  public Object getGroup(int groupPosition) {
      return tocLinks.get(groupPosition);
  }
  
  @Override
  public int getGroupCount() {
      return tocLinks.size();
  }
  
  @Override
  public long getGroupId(int groupPosition) {
      return (long) (groupPosition * 1024);
  }
  
  @Override
  public Object getChild(int groupPosition, int childPosition) {
      List&lt;TOCLink&gt; childTocLinks = tocLinks.get(groupPosition).getTocLinks();
      return childTocLinks.get(childPosition);
  }
  
  @Override
  public long getChildId(int groupPosition, int childPosition) {
      return (long) (groupPosition * 1024 + childPosition);
  }
  
  @Override
  public boolean hasStableIds() {
      return false;
  }
  
  @Override
  public boolean isChildSelectable(int groupPosition, int childPosition) {
      return true;
  }
  
  @Override
  public View getGroupView(int groupPosition, boolean b, View convertView, ViewGroup viewGroup) {
      TOCLink tocLink = (TOCLink) getGroup(groupPosition);
      if (convertView == null) {
          LayoutInflater inflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = inflater.inflate(R.layout.list_header, null);
      }
  
      TextView groupHeader = (TextView) convertView.findViewById(R.id.header);
      groupHeader.setText(tocLink.getSectionTitle());
  
      return convertView;
  }
  
  @Override
  public View getChildView(int groupPosition, int childPosition, boolean b, View convertView, ViewGroup viewGroup) {
      TOCLink tocLink = (TOCLink) getChild(groupPosition, childPosition);
      if (convertView == null) {
          LayoutInflater inflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = inflater.inflate(R.layout.list_item, null);
      }
  
      TextView childItem = (TextView) convertView.findViewById(R.id.item);
      childItem.setText(tocLink.getSectionTitle());
  
      /*TOCLink tocLink1 = tocLinks.get(groupPosition).getTocLinks().get(childPosition);
      if (tocLink1.getTocLinks().size() &gt; 0) {
          new TableOfContentsAdapter(context, tocLink1.getTocLinks());
      }*/
      return convertView;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I want to implement multilevel expandable list view with single adapter. Problem here is i'm able to go to level 1 but not further.</p>
  
  <p>How can resolve this problem?</p>