How to update/refresh specific item in RecyclerView

前端 未结 13 1362
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 18:31

I\'m trying to refresh specific item in RecyclerView.

Story: Whenever user clicks on item, it shows AlertDialog. User can

13条回答
  •  星月不相逢
    2020-11-29 18:49

    I got to solve this issue by catching the position of the item that needed to be modified and then in the adapter call

    public void refreshBlockOverlay(int position) {
        notifyItemChanged(position);
    }
    

    , this will call onBindViewHolder(ViewHolder holder, int position) for this specific item at this specific position.

提交回复
热议问题