using notifyItemRemoved or notifyDataSetChanged with RecyclerView in Android

后端 未结 8 2246
忘掉有多难
忘掉有多难 2020-12-04 17:28

I am creating a list of cards to display using the RecyclerView, where each card has a button to remove that card from the list.

When i use notifyItemRemoved

8条回答
  •  醉梦人生
    2020-12-04 17:58

    As @pskink suggested it was supposed to be (index+1) in my case with notifyItemRemoved(index+1), probably because i am reserving the top index i.e. position=0 for a header.

提交回复
热议问题