Issue
I have two adapters inside a ConcatAdapter, when I invoke notifyItemRangeChanged()
on one of the child adapters, the RecyclerView does not response.
For details, before I call notifyItemRangeChanged()
, I added some data to the child adapter.
Say the child adapter contains 10 items at the beginning, then I appended 10 new items to it, and I want the recyclerView to show the appended items by calling notifyItemRangeChanged(10, 10)
, with no luck.
However, I found notifyItemRangeInserted()
works just fine. Any one knowns why?
Solution
when you are adding new data to your list in that case notifyItemRangeInserted()
should be called as it's name says. notifyItemRangeChanged()
is used when you have updated the existing data range.
Answered By - Ashutosh Ojha
Answer Checked By - David Marino (JavaFixing Volunteer)