# AdapterListUpdateCallback

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1  
Summary:[Ctors](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback#)  

# AdapterListUpdateCallback

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
AdapterListUpdateCallback
`  
`

extends Object


``


implements

`[ListUpdateCallback](https://developer.android.com/reference/android/support/v7/util/ListUpdateCallback)`


`

|---|---------------------------------------------------|
| java.lang.Object                                     ||
| ↳ | android.support.v7.util.AdapterListUpdateCallback |

<br />

*** ** * ** ***

ListUpdateCallback that dispatches update events to the given adapter.  
**See also:**

- [dispatchUpdatesTo(RecyclerView.Adapter)](https://developer.android.com/reference/android/support/v7/util/DiffUtil.DiffResult#dispatchUpdatesTo(android.support.v7.widget.RecyclerView.Adapter))

## Summary

|                                                                                                                                                                                              ### Public constructors                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[AdapterListUpdateCallback](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback#AdapterListUpdateCallback(android.support.v7.widget.RecyclerView.Adapter))`(`[Adapter](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter)` adapter) ` Creates an AdapterListUpdateCallback that will dispatch update events to the given adapter. |

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

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback#)From interface` `[android.support.v7.util.ListUpdateCallback](https://developer.android.com/reference/android/support/v7/util/ListUpdateCallback)` ` |------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[onChanged](https://developer.android.com/reference/android/support/v7/util/ListUpdateCallback#onChanged(int, int, java.lang.Object))`(int position, int count, Object payload) ` Called when`count`number of items are updated at the given position. | | ` abstract void` | ` `[onInserted](https://developer.android.com/reference/android/support/v7/util/ListUpdateCallback#onInserted(int, int))`(int position, int count) ` Called when`count`number of items are inserted at the given position.                                | | ` abstract void` | ` `[onMoved](https://developer.android.com/reference/android/support/v7/util/ListUpdateCallback#onMoved(int, int))`(int fromPosition, int toPosition) ` Called when an item changes its position in the list.                                             | | ` abstract void` | ` `[onRemoved](https://developer.android.com/reference/android/support/v7/util/ListUpdateCallback#onRemoved(int, int))`(int position, int count) ` Called when`count`number of items are removed from the given position.                                 | ||

## Public constructors

### AdapterListUpdateCallback

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
AdapterListUpdateCallback (Adapter adapter)
```

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

<br />

|                          Parameters                          ||
|-----------|---------------------------------------------------|
| `adapter` | `Adapter`: The Adapter to send updates to. <br /> |

## Public methods

### onChanged

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

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

<br />

|                                 Parameters                                 ||
|------------|----------------------------------------------------------------|
| `position` | `int`: The position of the item which has been updated. <br /> |
| `count`    | `int`: The number of items which has changed. <br />           |
| `payload`  | `Object` <br />                                                |

### onInserted

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

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

<br />

|                             Parameters                              ||
|------------|---------------------------------------------------------|
| `position` | `int`: The position of the new item. <br />             |
| `count`    | `int`: The number of items that have been added. <br /> |

### onMoved

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

Called when an item changes its position in the list.

<br />

|                                    Parameters                                    ||
|----------------|------------------------------------------------------------------|
| `fromPosition` | `int`: The previous position of the item before the move. <br /> |
| `toPosition`   | `int`: The new position of the item. <br />                      |

### onRemoved

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

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

<br />

|                                 Parameters                                 ||
|------------|----------------------------------------------------------------|
| `position` | `int`: The position of the item which has been removed. <br /> |
| `count`    | `int`: The number of items which have been removed. <br />     |

-

  ## Interfaces

  - [ListUpdateCallback](https://developer.android.com/reference/android/support/v7/util/ListUpdateCallback)
-

  ## Classes

  - [AdapterListUpdateCallback](https://developer.android.com/reference/android/support/v7/util/AdapterListUpdateCallback)
  - [AsyncListUtil](https://developer.android.com/reference/android/support/v7/util/AsyncListUtil)
  - [AsyncListUtil.DataCallback](https://developer.android.com/reference/android/support/v7/util/AsyncListUtil.DataCallback)
  - [AsyncListUtil.ViewCallback](https://developer.android.com/reference/android/support/v7/util/AsyncListUtil.ViewCallback)
  - [BatchingListUpdateCallback](https://developer.android.com/reference/android/support/v7/util/BatchingListUpdateCallback)
  - [DiffUtil](https://developer.android.com/reference/android/support/v7/util/DiffUtil)
  - [DiffUtil.Callback](https://developer.android.com/reference/android/support/v7/util/DiffUtil.Callback)
  - [DiffUtil.DiffResult](https://developer.android.com/reference/android/support/v7/util/DiffUtil.DiffResult)
  - [DiffUtil.ItemCallback](https://developer.android.com/reference/android/support/v7/util/DiffUtil.ItemCallback)
  - [SortedList](https://developer.android.com/reference/android/support/v7/util/SortedList)
  - [SortedList.BatchedCallback](https://developer.android.com/reference/android/support/v7/util/SortedList.BatchedCallback)
  - [SortedList.Callback](https://developer.android.com/reference/android/support/v7/util/SortedList.Callback)