Best way to update data with a RecyclerView adapter [duplicate]
问题 This question already has an answer here: How to update RecyclerView Adapter Data? 12 answers When I have to use a classic adapter with a ListView, I update my data in the ListView like this: myAdapter.swapArray(data); public swapArray(List<Data> data) { clear(); addAll(data); notifyDataSetChanged(); } I would like to know what is the best practice for a RecyclerView. Because in a RecyclerView adapter you can\'t do a clear and addAll as in ListView . So I tried just with a