title: Is this ArrayAdapter suitable for use with CommonsWare MergeAdapter? If so, why is it not working?
body: <p>I'm attempting to use CommonsWare's <code>MergeAdapter</code> class and having limited success. In particular, I am not sure if 1) my <code>ArrayAdapter</code> is suitable for use, 2) if I am adding it correctly, and 3) if I am doing all that is necessary to wire everything up.</p>
  
  <p>Here is my subclass of <code>ArrayAdapter</code>:</p>
  
  <pre><code>class PDLAdapter extends ArrayAdapter&lt;PartnerDisease&gt; {
  
      public PDLAdapter(final Context context) {
          super(context, 0);
      }
  
      @Override
      public View getView(final int position, View convertView, final ViewGroup parent) {
          ViewHolder viewHolder;
  
          if (convertView == null) {
              convertView = mInflater.inflate(R.layout.partnerdisease_list_item, null);
              viewHolder = new ViewHolder(convertView);
              convertView.setTag(viewHolder);
          } else {
              viewHolder = (ViewHolder) convertView.getTag();
          }
  
          viewHolder.populateViews(getItem(position));
  
          return convertView;
      }
  
  }
  </code></pre>
  
  <p>Here is my object <code>StructuredSubDisease</code> (the name makes no sense if you actually consider it's a top-level object containing sub diseases, but whatever):</p>
  
  <pre><code>class StructuredSubDisease {
      public String headingText;
      public ArrayList&lt;PartnerDisease&gt; subDiseases;
  
      public View headingView() {
          View returnView = mInflater.inflate(R.layout.partnerdisease_list_item, null);
          TextView t = (TextView) returnView.findViewById(R.id.tv_displayname);
          t.setText(headingText);
          return returnView;
      }
  }
  </code></pre>
  
  <p>...and here is where the "magic" is supposed to be happening.</p>
  
  <pre><code>            for (StructuredSubDisease s : subDiseaseList) {
                  mMergeAdapter.addView(s.headingView()); // @Alex, &lt;--- thing 1
  
                  PartnerDiseaseListAdapter adapter = new PartnerDiseaseListAdapter(this);
  
                  for (PartnerDisease p : s.subDiseases) {
                      adapter.add(p);
                  }
  
                  mMergeAdapter.addAdapter(adapter); // &lt;--- and thing 2
              }
  </code></pre>
  
  <p>I have <code>Log</code>ged the count:</p>
  
  <pre><code>   Log.i("mergecount", "" + mMergeAdapter.getCount());
  </code></pre>
  
  <p>This returns <code>1</code>, where I would expect <code>2</code>.</p>
  
  <p>EDIT: I forgot to mention, the result of this is that the <code>headingView()</code> is displayed with the proper heading text, but there is no list beneath it.</p>
  
  <p>Where am I going wrong?</p>