# AdapterListUpdateCallback

Artifact: [androidx.recyclerview:recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview) [View Source](https://cs.android.com/search?q=file:androidx/recyclerview/widget/AdapterListUpdateCallback.java+class:androidx.recyclerview.widget.AdapterListUpdateCallback) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

*** ** * ** ***


```
public final class AdapterListUpdateCallback implements ListUpdateCallback
```

<br />

*** ** * ** ***

ListUpdateCallback that dispatches update events to the given adapter.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil.DiffResult#dispatchUpdatesTo(androidx.recyclerview.widget.RecyclerView.Adapter)` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/recyclerview/widget/AdapterListUpdateCallback#AdapterListUpdateCallback(androidx.recyclerview.widget.RecyclerView.Adapter)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter adapter)` Creates an AdapterListUpdateCallback that will dispatch update events to the given adapter. |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/recyclerview/widget/AdapterListUpdateCallback#onChanged(int,int,java.lang.Object)(int position, int count, https://developer.android.com/reference/java/lang/Object.html payload)` Called when count} number of items are updated at the given position. |
| `void` | `https://developer.android.com/reference/androidx/recyclerview/widget/AdapterListUpdateCallback#onInserted(int,int)(int position, int count)` Called when count} number of items are inserted at the given position. |
| `void` | `https://developer.android.com/reference/androidx/recyclerview/widget/AdapterListUpdateCallback#onMoved(int,int)(int fromPosition, int toPosition)` Called when an item changes its position in the list. |
| `void` | `https://developer.android.com/reference/androidx/recyclerview/widget/AdapterListUpdateCallback#onRemoved(int,int)(int position, int count)` Called when count} number of items are removed from the given position. |

## Public constructors

### AdapterListUpdateCallback

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

```
public AdapterListUpdateCallback(@NonNull RecyclerView.Adapter adapter)
```

Creates an AdapterListUpdateCallback that will dispatch update events to the given adapter.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter adapter` | The Adapter to send updates to. |

## Public methods

### onChanged

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.4.0)

```
public void onChanged(int position, int count, Object payload)
```

Called when count} number of items are updated at the given position.

### onInserted

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.4.0)

```
public void onInserted(int position, int count)
```

Called when count} number of items are inserted at the given position.

### onMoved

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.4.0)

```
public void onMoved(int fromPosition, int toPosition)
```

Called when an item changes its position in the list.

### onRemoved

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.4.0)

```
public void onRemoved(int position, int count)
```

Called when count} number of items are removed from the given position.