Inconsistency detected in RecyclerView, How to change contents of RecyclerView while scrolling

前端 未结 26 2516
借酒劲吻你
借酒劲吻你 2020-12-01 00:59

I\'m using RecyclerView to display name of the items. My row contains single TextView. Item names are stored in List mItemList<

26条回答
  •  半阙折子戏
    2020-12-01 01:41

    I have replicated this issue. This happened when we remove items in the background thread from mList but dont call notifyDataSetChanged(). Now If we scroll This exception is comming.

    java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 86(offset:86).state:100

    Initially I had 100 items and removed few items from background thread.

    Seems like Recyclerview calls getItemCount() itself to validate the state.

提交回复
热议问题