Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException after click on expanded sticky header #299

Closed
luweglinski opened this issue Feb 22, 2017 · 1 comment
Closed

ClassCastException after click on expanded sticky header #299

luweglinski opened this issue Feb 22, 2017 · 1 comment

Comments

@luweglinski
Copy link

I think i found bug in latest commit "AutoCollapseOnExpand", sometimes click on expanded sticky header i've got ClassCastException:

  java.lang.ClassCastException: eu.davidea.samples.flexibleadapter.items.SubItem$ChildViewHolder cannot be cast to eu.davidea.samples.flexibleadapter.items.ExpandableHeaderItem$ExpandableHeaderViewHolder
                                                                                      at eu.davidea.samples.flexibleadapter.items.ExpandableHeaderItem.bindViewHolder(ExpandableHeaderItem.java:27)
                                                                                      at eu.davidea.flexibleadapter.FlexibleAdapter.onBindViewHolder(FlexibleAdapter.java:1870)
                                                                                      at eu.davidea.flexibleadapter.FlexibleAdapter.onBindViewHolder(FlexibleAdapter.java:1840)
                                                                                      at eu.davidea.flexibleadapter.helpers.StickyHeaderHelper.updateHeader(StickyHeaderHelper.java:169)
                                                                                      at eu.davidea.flexibleadapter.helpers.StickyHeaderHelper.updateOrClearHeader(StickyHeaderHelper.java:143)
                                                                                      at eu.davidea.flexibleadapter.FlexibleAdapter$AdapterDataObserver.updateOrClearHeader(FlexibleAdapter.java:5232)
                                                                                      at eu.davidea.flexibleadapter.FlexibleAdapter$AdapterDataObserver.onItemRangeRemoved(FlexibleAdapter.java:5251)
                                                                                      at android.support.v7.widget.RecyclerView$AdapterDataObservable.notifyItemRangeRemoved(RecyclerView.java:11104)
                                                                                      at android.support.v7.widget.RecyclerView$Adapter.notifyItemRangeRemoved(RecyclerView.java:6736)
                                                                                      at eu.davidea.flexibleadapter.FlexibleAdapter.collapse(FlexibleAdapter.java:2708)
                                                                                      at eu.davidea.viewholders.ExpandableViewHolder.collapseView(ExpandableViewHolder.java:153)
                                                                                      at eu.davidea.samples.flexibleadapter.items.ExpandableHeaderItem$ExpandableHeaderViewHolder.collapseView(ExpandableHeaderItem.java:238)
                                                                                      at eu.davidea.viewholders.ExpandableViewHolder.toggleExpansion(ExpandableViewHolder.java:124)
                                                                                      at eu.davidea.samples.flexibleadapter.items.ExpandableHeaderItem$ExpandableHeaderViewHolder.toggleExpansion(ExpandableHeaderItem.java:209)
                                                                                      at eu.davidea.viewholders.ExpandableViewHolder.onClick(ExpandableViewHolder.java:171)
@davideas davideas added the bug label Feb 22, 2017
@davideas
Copy link
Owner

Thanks @Szynka, latest commit resolved in part the problem of notification of autoCollapse, but notifying before the delete notifications seems not good, so I inverted them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants