Android RecyclerView : notifyDataSetChanged() IllegalStateException

前端 未结 22 1860
天涯浪人
天涯浪人 2020-11-28 02:57

I\'m trying to update the items of a recycleview using notifyDataSetChanged().

This is my onBindViewHolder() method in the recycleview adapter.

@Over         


        
22条回答
  •  醉话见心
    2020-11-28 03:55

    Simple use Post:

    new Handler().post(new Runnable() {
            @Override
            public void run() {
                    mAdapter.notifyItemChanged(mAdapter.getItemCount() - 1);
                }
            }
        });
    

提交回复
热议问题