java.lang.IndexOutOfBoundsException

Inconsistency detected. Invalid view holder adapter positionViewHolder{435debc0 position=2 id=-1, oldPos=1, pLpos:1 scrap tmpDetached not recyclable(1)undefined adapter position 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{435debc0 position=2 id=-1, oldPos=1, pLpos:1 scrap tmpDetached not recyclable(1)undefined adapter position no parent} at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:3498) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3628) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3609) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1859) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1311) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1274) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:525) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2072) at android.support.v7.widget.RecyclerView.resumeRequestLayout(RecyclerView.java:1231) at android.support.v7.widget.RecyclerView$1.run(RecyclerView.java:207) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:543) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(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 visitorOnce,
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
Stefan BrauneStefan Braune
11 times, last one
Unknown visitor
Unknown visitorOnce,
27 more bugmates