I’m using a RecyclerView and
.notifyItemInserted only inserts one item into the RecyclerView. How would I do that say, for multiple items? I want to AVOID using
Say I have
25 items, I want to insert
another 20, what method would I call?
You can use
notifyItemRangeInserted to notify for multiple insertion.
void notifyItemRangeInserted (int positionStart, int itemCount)
According official documentation
Notify any registered observers that the currently reflected
items starting at
positionStarthave been newly inserted. The items
previously located at
positionStartand beyond can now be found
starting at position
positionStart + itemCount.