title: android attaching multiple adapters to one adapter
body: <p>I have been using the <a href="http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/" rel="nofollow">SeparatedListAdapter</a> which is very well known and works perfectly, but it seems that I cannot use the addSection() to add a SimpleAdapter, because the application is terminated. I'm providing some code to show you what I'm trying to do and get some guidance in order solve this issue. Please let me know if you need any other piece of code or anything:</p>
  
  <pre><code>// Declarations
  
  private SimpleAdapter _resultsAdapter;
  private ArrayAdapter&lt;String&gt; _adapter;
  private List&lt;Map&lt;String,?&gt;&gt; _resultsList;
  private ArrayList&lt;String&gt; _stringList = new ArrayList&lt;String&gt;();
  
  // Much of source code here
  
  // The following lines work (I can addSection()).
      _adapter =  new ArrayAdapter&lt;String&gt;(this, R.layout.custom_list_item, _stringList);
      _sla = new SeparatedListAdapter(this);
      _sla.addSection("Input Data", _adapter);  
  
  // More source code here...
  
  // The following causes a crash
  _resultsList.add(createItem(resultTitle.toString(), fieldDetails.toString())); // Loading data in a loop (works 100%)
  _resultsAdapter = new SimpleAdapter(CompanyInfoServiceViewActivity.this, _resultsList, R.layout.list_complex, new String[] { ITEM_TITLE, ITEM_CAPTION }, new int[] { R.id.list_complex_title, R.id.list_complex_caption });
  _sla.addSection("Results", _resultsAdapter); // Crashes here. _sla is not null (see above)
  </code></pre>