How to update RecyclerView Adapter Data?

前端 未结 13 2307
误落风尘
误落风尘 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:22

    I found out that a really simple way to reload the RecyclerView is to just call

    recyclerView.removeAllViews();
    

    This will first remove all content of the RecyclerView and then add it again with the updated values.

提交回复
热议问题