# PagedList.Callback

# PagedList.Callback

Artifact:[androidx.paging:paging-common](https://developer.android.com/jetpack/androidx/releases/paging)  
[View Source](https://cs.android.com/search?q=file:androidx/paging/PagedList.kt+class:androidx.paging.PagedList.Callback)  
Added in[2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)  
Deprecated in[3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/paging/PagedList.Callback "View this page in Java")
Common/AllAndroid/JVMNative/C/iOSJavaScript
  - android  

  ```
  abstract class PagedList.Callback
  ```

*** ** * ** ***

| **This class is deprecated.**   
| PagedList is deprecated and has been replaced by PagingData

Callback signaling when content is loaded into the list.

Can be used to listen to items being paged in and out. These calls will be dispatched on the dispatcher defined by[PagedList.Builder.setNotifyDispatcher](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setNotifyDispatcher(kotlinx.coroutines.CoroutineDispatcher)), which is generally the main/UI thread.

## Summary

|                                                                                           ### Public constructors                                                                                            |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| ~~[Callback](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#Callback())~~`()` **This function is deprecated.**PagedList is deprecated and has been replaced by PagingData | android |

|                                   ### Public functions                                   |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `abstract `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | ~~[onChanged](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#onChanged(kotlin.Int,kotlin.Int))~~`(position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.**PagedList is deprecated and has been replaced by PagingData   | android |
| `abstract `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | ~~[onInserted](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#onInserted(kotlin.Int,kotlin.Int))~~`(position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.**PagedList is deprecated and has been replaced by PagingData | android |
| `abstract `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | ~~[onRemoved](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#onRemoved(kotlin.Int,kotlin.Int))~~`(position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.**PagedList is deprecated and has been replaced by PagingData   | android |

## Public constructors

### Callback

android  
Added in[2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)  
Deprecated in[3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)  

```
[Callback](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#Callback())()
```
| **This function is deprecated.**   
| PagedList is deprecated and has been replaced by PagingData

## Public functions

### onChanged

android  
Added in[2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)  
Deprecated in[3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)  

```
abstract fun [onChanged](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#onChanged(kotlin.Int,kotlin.Int))(position: Int, count: Int): Unit
```
| **This function is deprecated.**   
| PagedList is deprecated and has been replaced by PagingData

Called when null padding items have been loaded to signal newly available data, or when data that hasn't been used in a while has been dropped, and swapped back to null.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| `position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Position of first newly loaded items, out of total number of items (including padded nulls). |
| `count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | Number of items loaded.                                                                      |

### onInserted

android  
Added in[2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)  
Deprecated in[3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)  

```
abstract fun [onInserted](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#onInserted(kotlin.Int,kotlin.Int))(position: Int, count: Int): Unit
```
| **This function is deprecated.**   
| PagedList is deprecated and has been replaced by PagingData

Called when new items have been loaded at the end or beginning of the list.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| `position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Position of the first newly loaded item (in practice, either`0`or`size - 1`. |
| `count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | Number of items loaded.                                                      |

### onRemoved

android  
Added in[2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)  
Deprecated in[3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)  

```
abstract fun [onRemoved](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback#onRemoved(kotlin.Int,kotlin.Int))(position: Int, count: Int): Unit
```
| **This function is deprecated.**   
| PagedList is deprecated and has been replaced by PagingData

Called when items have been removed at the end or beginning of the list, and have not been replaced by padded nulls.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| `position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Position of the first newly loaded item (in practice, either`0`or`size - 1`. |
| `count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | Number of items loaded.                                                      |