notifyItemChanged

fun notifyItemChanged(position: Int)(source)

Notify any registered observers that the item at position has changed. Equivalent to calling notifyItemChanged(position, null);.

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

Parameters

position

Position of the item that has changed

See also


fun notifyItemChanged(position: Int, @Nullable payload: Any)(source)

Notify any registered observers that the item at position has changed with an optional payload object.

This is an item change event, not a structural change event. It indicates that any reflection of the data at position is out of date and should be updated. The item at position retains 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

position

Position of the item that has changed

payload

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

See also