In order to update the data in the adapter, I used this method in the adapter
public void setData(@NotNull List<HomeScreenAdapterItem> iData) { mHomeItems = iData; notifyDataSetChanged(); } then changed implementation to DiffUtill
public void setData(@NotNull List<HomeScreenAdapterItem> iData) { MyDiffUtil<HomeScreenAdapterItem> diff = new MyDiffUtil<>(mHomeItems, iData); DiffUtil.DiffResult result = DiffUtil.calculateDiff(diff, false); mHomeItems = iData; result.dispatchUpdatesTo(this); } How it works for me. There is a screen with RecyclerView , when I click on a list item, the next screen opens and it is possible to change the list data, including the sequence of elements.
So, with the first approach, when you return to the first screen, the replacement of the list items is not noticeable, the updated data is immediately visible, and with the DiffUtill , the screen opens and I see how the new elements change to new ones.
Question
How to make the second method work at the speed of the first?
DiffUtillif the animation is not needed? - ermak0ffnotifyItemChangesmethodnotifyItemChangesvery expensive in terms of resources. But I don’t need animation - Aleksey TimoshchenkocalculateDiff(... , FALSE)which should turn off animation. - Aleksey Timoshchenko