Closed luojt closed 4 years ago
thanks for reporting it, I tried the steps mentioned and did not see any crash
Section sectionA = addNewSectionToAdapter();
Section sectionB = addNewSectionToAdapter();
Section sectionC = addNewSectionToAdapter();
sectionedAdapter.removeAllSections();
sectionedAdapter.addSection(sectionB);
sectionedAdapter.addSection(sectionC);
sectionedAdapter.notifyDataSetChanged();
please use the pull request template to report issues so more details can be provided
I can reproduce this issue. In my case i'm calling removeAllSections, then adding 8 other sections and finally I call notifyDataSetChanged.
If there are section a, Section B, Section C, all addsections, then the sectionedrecyclerviewadapter calls the removeallsections() method, then addsection (b), addsection (c), and calls the notifydatasetchanged() method, an error will be reported. The viewholder of section a is obtained from the onbinditemviewholder of section B, java.lang.ClassCastException