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

Crash related to scrolling while loading more #3

Closed
atroutt opened this issue Jul 12, 2016 · 1 comment
Closed

Crash related to scrolling while loading more #3

atroutt opened this issue Jul 12, 2016 · 1 comment

Comments

@atroutt
Copy link
Contributor

atroutt commented Jul 12, 2016

I had a batch size of 20 and when I hit the top the app crashes with an error

E/AndroidRuntime: FATAL EXCEPTION: main java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{2e25931 position=34 id=-1, oldPos=14, pLpos:14 scrap [attachedScrap] tmpDetached no parent} at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:4505) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4636) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1390) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:549) at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:2979) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2904) at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1482) at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:147) at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4037) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:603) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:746) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

I found a similar error in another library and someone there suggested that the solution is to block scrolling while the adapter's dataset is being updated frogermcs/InstaMaterial#25 I think this would need to be done in the library's code.

@MatthewTPage
Copy link
Contributor

I messed around with this area of the code a lot today. I can't replicate the error, so let's consider it solved for now.

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

No branches or pull requests

2 participants