Set notifyDataSetChanged() on Recyclerview adapter

前端 未结 5 1003
说谎
说谎 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:37

    Every time you fill your list call the method below:

    if (adapter != null) // it works second time and later
       adapter.notifyDataSetChanged();
    else { // it works first time
      adapter = new AdapterClass(context,list);
      listView.setAdapter(adapter);
    }
    

提交回复
热议问题