notifyItemRangeChanged

fun notifyItemRangeChanged(positionStart: Int, itemCount: Int)(source)

Notify any registered observers that the itemCount items starting at position positionStart have changed. Equivalent to calling notifyItemRangeChanged(position, itemCount, null);.

This is an item change event, not a structural change event. It indicates that any reflection of the data in the given position range is out of date and should be updated. The items in the given range retain the same identity.

Parameters

positionStart

Position of the first item that has changed

itemCount

Number of items that have changed

See also


fun notifyItemRangeChanged(positionStart: Int, itemCount: Int, @Nullable payload: Any)(source)

Notify any registered observers that the itemCount items starting at position positionStart have changed. An optional payload can be passed to each changed item.

This is an item change event, not a structural change event. It indicates that any reflection of the data in the given position range is out of date and should be updated. The items in the given range retain the same identity.

Client can optionally pass a payload for partial change. These payloads will be merged and may be passed to adapter's onBindViewHolder if the item is already represented by a ViewHolder and it will be rebound to the same ViewHolder. A notifyItemRangeChanged() with null payload will clear all existing payloads on that item and prevent future payload until onBindViewHolder is called. Adapter should not assume that the payload will always be passed to onBindViewHolder(), e.g. when the view is not attached, the payload will be simply dropped.

Parameters

positionStart

Position of the first item that has changed

itemCount

Number of items that have changed

payload

Optional parameter, use null to identify a "full" update

See also