How to update RecyclerView Adapter Data?

前端 未结 13 2313
误落风尘
误落风尘 2020-11-22 03:48

Trying to figure out what is the issue with updating RecyclerView\'s Adapter.

After I get a new List of products, I tried to:

  1. Update t

13条回答
  •  粉色の甜心
    2020-11-22 04:26

    you have 2 options to do this: refresh UI from the adapter:

    mAdapter.notifyDataSetChanged();
    

    or refresh it from recyclerView itself:

    recyclerView.invalidate();
    

提交回复
热议问题