bgogetap / StickyHeaders

Easily add Sticky Headers to your RecyclerView
Apache License 2.0
521 stars 88 forks source link

onBinViewHolder sometimes not called for headers #69

Closed mobilekosmos closed 6 years ago

mobilekosmos commented 6 years ago

I have an issue that's mostly always reproducible where onBindViewHolder wouldn't be called for the sticky headers, do you have an idea if this error could come from the lib itself? Because it only happens with the headers. I can reproduce it in landscape mode where I have a list with:

When I scroll a few times sometimes the first header would have the content of the second one when scrolling up again and sometimes the second header will have the content of the first one the first time I scroll down.

mobilekosmos commented 6 years ago

Ok, problem was using setHasStableIDs in the adapter, while the headers ofcourse don't have an ID or both have the same ID (-1), so RecyclerView saw both items as equal I suppose.