java.lang.IndexOutOfBoundsException

Inconsistency detected. Invalid view holder adapter positionViewHolder{fe4b454 position=4 id=-1, oldPos=1, pLpos:1 scrap [attachedScrap] tmpDetached no parent}

Samebug tips1

Try to use notifyDataSetChanged() instead of notifyItemRemoved(), there's a bug in RecyclerView and notifyItemRemoved() does not work in some environments.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Stack trace

  • java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{fe4b454 position=4 id=-1, oldPos=1, pLpos:1 scrap [attachedScrap] tmpDetached no parent} at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:4499) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4630) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4611) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1988) at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:528) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1347) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574) at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170) at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:2977) at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2594) at android.view.View.measure(View.java:18026) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692) at android.widget.LinearLayout.measureVertical(LinearLayout.java:760) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:18026) at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1292) at android.widget.FrameLayout.onMeasure(FrameLayout.java:471) at android.widget.ScrollView.onMeasure(ScrollView.java:348) at android.view.View.measure(View.java:18026) at com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout.onMeasure(SwipyRefreshLayout.java:576) at android.view.View.measure(View.java:18026) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692) at android.widget.LinearLayout.measureVertical(LinearLayout.java:760) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:18026) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705) at android.widget.FrameLayout.onMeasure(FrameLayout.java:471) at android.view.View.measure(View.java:18026) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692) at android.widget.LinearLayout.measureVertical(LinearLayout.java:760) at android.widget.LinearLayout.onMeasure(LinearLayout.java:629) at android.view.View.measure(View.java:18026) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5705) at android.widget.FrameLayout.onMeasure(FrameLayout.java:471) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2805) at android.view.View.measure(View.java:18026) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2480) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1457) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1692) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1335) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6755) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:800) at android.view.Choreographer.doCallbacks(Choreographer.java:603) at android.view.Choreographer.doFrame(Choreographer.java:572) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:192) at android.app.ActivityThread.main(ActivityThread.java:5855) at java.lang.reflect.Method.invoke(Native Method)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Unknown visitor
Unknown visitor2 times, last one
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
Agócs TamásAgócs Tamás
Once,
Unknown visitor
Unknown visitor3 times, last one
27 more bugmates