java.lang.IndexOutOfBoundsException

tip

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

tip

You have to provide valid identical number for each child items.

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

  • Crash
    via GitHub by SlideAutoreport
    ,
  • note 2 kitkat
    via GitHub by SlideAutoreport
    ,
  • GitHub comment 262#270123552
    via GitHub by SolidScorpion
    ,
    • java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{43ea2e18 position=3 id=-1, oldPos=-1, pLpos:-1 scrap tmpDetached no parent} at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:3887) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4018) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3999) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1892) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1338) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1301) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:534) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2411) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2709)

    Users with the same issue

    filpgame
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Stefan Braune
    2 times, last one,
    Unknown visitor1 times, last one,
    31 more bugmates