ShamylZakariya / StickyHeaders

Adapter and LayoutManager for Android RecyclerView which enables sticky header positioning.
MIT License
1.4k stars 185 forks source link

Class cast exception after upgrading to android x #102

Closed ibrarHussain87 closed 5 years ago

ibrarHussain87 commented 5 years ago

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ddroid.apps.antivirus, PID: 15174 java.lang.ClassCastException: org.zakariya.stickyheaders.SectioningAdapter$HeaderViewHolder cannot be cast to com.ddroid.apps.antivirus.adapter.AppLockAdapter$HeaderViewHolder at com.ddroid.apps.antivirus.adapter.AppLockAdapter.onBindHeaderViewHolder(AppLockAdapter.java:100) at org.zakariya.stickyheaders.SectioningAdapter.onBindViewHolder(SectioningAdapter.java:1329) at org.zakariya.stickyheaders.SectioningAdapter.onBindViewHolder(SectioningAdapter.java:30) at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781) at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823) at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752) at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854) at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230) at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924) at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641) at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1189) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1982) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1826) at android.widget.LinearLayout.onLayout(LinearLayout.java:1735) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:383) at android.widget.FrameLayout.onLayout(FrameLayout.java:321) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1982) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1826) at android.widget.LinearLayout.onLayout(LinearLayout.java:1735) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:383) at android.widget.FrameLayout.onLayout(FrameLayout.java:321) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1982) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1826) at android.widget.LinearLayout.onLayout(LinearLayout.java:1735) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:383) at android.widget.FrameLayout.onLayout(FrameLayout.java:321) at com.android.internal.policy.DecorView.onLayout(DecorView.java:751) at android.view.View.layout(View.java:17854) at android.view.ViewGroup.layout(ViewGroup.java:5758) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2720) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2393) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1471) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7009) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:907) at android.view.Choreographer.doCallbacks(Choreographer.java:709) at android.view.Choreographer.doFrame(Choreographer.java:644) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:893) at android.os.Handler.handleCallback(Handler.java:836) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6293) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1065) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926)

ShamylZakariya commented 5 years ago

Hi, I have just updated to 0.7.8, which is built on androidx. It should resolve your issue.