Set notifyDataSetChanged() on Recyclerview adapter

前端 未结 5 992
说谎
说谎 2020-12-11 02:25

I\'m implementing an endless data loading for a RecyclerView. When software detects that last item is going to be shown, it downloads new items and call to the loadMor

5条回答
  •  旧巷少年郎
    2020-12-11 02:46

    I solved this with added method in RVAdapter that call notifyDataSetChanged().

    Simply in RVAdapter:

    public void refreshList(){
        notifyDataSetChanged();
    }
    

    and call this method in MainActivity when need:

    rVAdapter.refreshList();

提交回复
热议问题