[android-developers] ListView with sections from a SINGLE Cursor

2010-06-16 Thread sasq
I've been looking around a lot on how to separate a ListView into sections with headers, and all solutions are based on using multiple adapters. I have only a single database query that is ordered by a specific field. I want to present this information in a ListView, and insert headings whenever

Re: [android-developers] ListView with sections from a SINGLE Cursor

2010-06-16 Thread Connick
I'm facing this exact challenge this morning! +1 On Wed, Jun 16, 2010 at 11:33 AM, sasq jonas.minnb...@gmail.com wrote: I've been looking around a lot on how to separate a ListView into sections with headers, and all solutions are based on using multiple adapters. I have only a single

Re: [android-developers] ListView with sections from a SINGLE Cursor

2010-06-16 Thread Brad Gies
Hi, Sorry, I don't have time to look up the links for you, but search this group for getItemViewType and getViewTypeCount. There was a thread in the last week that had a couple of very good links explaining exactly what you want to do. I'm pretty sure the message you want was from Mark

Re: [android-developers] ListView with sections from a SINGLE Cursor

2010-06-16 Thread Mark Murphy
Actually inserting the headers as a second viewtype requires you to scan the whole result to get an accurate count. The best I've come up with is returning the Header combined with the first item as a single view so as to keep the count correct, but then selection looks wrong. Any tips?