-
Notifications
You must be signed in to change notification settings - Fork 552
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
cannot be cast in StickyHeaderHelper #594
Comments
very hard to reproduce (was able 2 times) |
@volser, I might have an idea. The stacktrace says it comes from an Adapter modification with AdatperDataObserver callback from RV. // #320 - To include adapter changes just notified we need a new layout pass:
// We must give time to LayoutManager otherwise ... will return wrong position!
mRecyclerView.postDelayed(new Runnable() {
@Override
public void run() {
if (areHeadersSticky()) mStickyHeaderHelper.updateOrClearHeader(true);
}
}, 50L); That 50ms might be too low, it might explain why it's hard to reproduce. |
Please try with 5.0.4-SNAPSHOT, this has 100ms delay.
|
@volser waiting your tests. Thanks :-) |
@davideas thank you! I will test soon, but it will take some time, cuz it's not so easy to reproduce ) |
I saw this issue #299
looks like similar, but marked as resolved.
I use last version 5.0.3
java.lang.ClassCastException: com.test.CategoryTableModelItem$ExpandableHeaderViewHolder cannot be cast to com.test.SubcategoryTableModelItem$ExpandableHeaderViewHolder
at com.test.SubcategoryTableModelItem.bindViewHolder(SubcategoryTableModelItem.java:32)
at eu.davidea.flexibleadapter.FlexibleAdapter.onBindViewHolder(FlexibleAdapter.java:1769)
at eu.davidea.flexibleadapter.FlexibleAdapter.onBindViewHolder(FlexibleAdapter.java:1746)
at eu.davidea.flexibleadapter.helpers.StickyHeaderHelper.updateHeader(StickyHeaderHelper.java:168)
at eu.davidea.flexibleadapter.helpers.StickyHeaderHelper.updateOrClearHeader(StickyHeaderHelper.java:139)
at eu.davidea.flexibleadapter.FlexibleAdapter$AdapterDataObserver$1.run(FlexibleAdapter.java:5282)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
The text was updated successfully, but these errors were encountered: