When i scroll my recyclerview too fast i am getting the following crash
java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true
at android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:5659)
at android.support.v7.widget.RecyclerView$Recycler.recycleView(RecyclerView.java:5603)
at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:277)
at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:324)
at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:337)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:344)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I had tried my every effort and get similar question on stackoverflow, but none of them were helpful like following links,
I have no knowledge of this crash from where it is occurring. Any help would be greatly appreciated. I am neither using "android:animateLayoutChanges="true"
Basically i had tried to merge these two different GitHub project,
My files links are as follows from pastbin,
Have you tried
layoutManager.setItemPrefetchEnabled(false);
? It worked for me.