luizgrp / SectionedRecyclerViewAdapter

An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.
MIT License
1.68k stars 372 forks source link

how to remove section if i removed all items inside it ? #74

Closed ahmedsaber00 closed 7 years ago

ahmedsaber00 commented 7 years ago

iam tring to remove section after removing all items inside it but i can't i tried this line if (section.getContentItemsTotal()==0) sectionAdapter.removeSection(String.valueOf(sectionTag)); but it crash with that error

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{532fa4d4 position=11 id=-1, oldPos=12, pLpos:12 scrap [attachedScrap] tmpDetached no parent}

what should i do if i want to delete a section ?

luizgrp commented 7 years ago

Have you tried the solutions proposed here? It looks like there is bug in the RecyclerView as per this link.