SimpleCursorAdapter with Sections in Android

Simon picture Simon · Jan 9, 2011 · Viewed 7.8k times · Source

Im at a bit of loss on this one on how to produce sections in a ListView when you use both Cursors and a Custom SimpleCursorAdapter.

Many of the docs out there reference using getView() etc, or creating several Adapters and adding section headers.

But these all appear to be based on BaseAdapters, ListAdapters, and ArrayAdapters etc.

Has anybody dealt with anything similar previously?

If not, any tips on how to make this work?

Thanks Simon

Answer

Erich Douglass picture Erich Douglass · Jan 9, 2011

I followed this tutorial and it worked out pretty well. The code allows you to use any sort of Adapter, so it works great with ArrayAdapter or CursorAdapter.