So there's your problem then, probably. The adapter expects each item to have the same items, so that it can assign the fields from your Cursor to the corresponding items in your list item layout. In other words, if your "normal" list item contains items with IDs A, B and C, them your "section" list items should also have items with IDs A, B and C, and those items should have the same type in both layouts as well. In your case, it looks like you have a TextView with a given ID in one layout, whereas in the other layout that same ID is either used for something that is not a TextView, or isn't present at all. If you need some of the items in your list to be different between your "normal" and "section" layouts, then you should override bindView and handle that in there.
On Thu, Sep 24, 2009 at 11:06 PM, Wouter <[email protected]> wrote: > > Np the headers are using a separate layout file.. > > On 25 sep, 00:04, Marco Nelissen <[email protected]> wrote: >> On Thu, Sep 24, 2009 at 2:12 PM, Wouter <[email protected]> wrote: >> >> > On 24 sep, 22:53, Marco Nelissen <[email protected]> wrote: >> >> On Thu, Sep 24, 2009 at 1:41 PM, Wouter <[email protected]> wrote: >> >> >> > I have no problem with the data mapping and TextViews. >> >> >> The stack trace and crash you're seeing indicate otherwise. >> >> Unless you're doing something specific in bindView, the adapter >> >> expects each list item layout to be the same. You are overriding >> >> getView and returning different kinds of views, so I would take >> >> another look at that, and make sure that those two kinds of views are >> >> compatible. >> >> > Each list item layout is the same. it uses R.layout.cinema_row! >> > The weird is it makes my list with headers (when i use >> > seperatedlistadapter) and when i scroll down, it crashes and gives >> > this error. >> > Really will take a look at it, if not i will put my source code here! >> >> >> > It fully works >> >> > when i don't use a seperatedList adapter.. >> >> > So there is problem with this seperatedListAdapter.. >> >> > Is there another way i can use to divide my list in sections with >> >> > headers? >> >> >> I don't know what effect you're trying to achieve, but in general you >> >> can override bindView and/or getView to make each item look exactly >> >> the way you want. >> >> > I have a list of movies with a release date. all the movies with same >> > date has to be listed under a header with date.. And every list item >> > has same layout, really don't get it :( >> >> Every list item, including the header items? In other words: do your >> header items use the same layout as your other list items? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

