# PagedList

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) 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)

*** ** * ** ***


```
public abstract class PagedList<T extends Object> extends AbstractList<@NonNull T>
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [java.util.AbstractCollection](https://developer.android.com/reference/java/util/AbstractCollection.html) |||
|   | ↳ | [java.util.AbstractList](https://developer.android.com/reference/java/util/AbstractList.html)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) T\> ||
|   |   | ↳ | [androidx.paging.PagedList](https://developer.android.com/reference/androidx/paging/PagedList) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Lazy loading list that pages in immutable content from a `https://developer.android.com/reference/androidx/paging/PagingSource`.

A `https://developer.android.com/reference/androidx/paging/PagedList` is a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` which loads its data in chunks (pages) from a `https://developer.android.com/reference/androidx/paging/PagingSource`. Items can be accessed with `https://developer.android.com/reference/androidx/paging/PagedList#get(kotlin.Int)`, and further loading can be triggered with `https://developer.android.com/reference/androidx/paging/PagedList#loadAround(kotlin.Int)`. To display a `https://developer.android.com/reference/androidx/paging/PagedList`, see `https://developer.android.com/reference/androidx/paging/PagedListAdapter`, which enables the binding of a `https://developer.android.com/reference/androidx/paging/PagedList` to a `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView`.

### Loading Data

All data in a `https://developer.android.com/reference/androidx/paging/PagedList` is loaded from its `https://developer.android.com/reference/androidx/paging/PagingSource`. Creating a `https://developer.android.com/reference/androidx/paging/PagedList` loads the first chunk of data from the `https://developer.android.com/reference/androidx/paging/PagingSource` immediately, and should for this reason be done on a background thread. The constructed `https://developer.android.com/reference/androidx/paging/PagedList` may then be passed to and used on the UI thread. This is done to prevent passing a list with no loaded content to the UI thread, which should generally not be presented to the user.

A `https://developer.android.com/reference/androidx/paging/PagedList` initially presents this first partial load as its content, and expands over time as content is loaded in. When `https://developer.android.com/reference/androidx/paging/PagedList#loadAround(kotlin.Int)` is called, items will be loaded in near the passed list index. If placeholder `null`s are present in the list, they will be replaced as content is loaded. If not, newly loaded items will be inserted at the beginning or end of the list.

`https://developer.android.com/reference/androidx/paging/PagedList` can present data for an unbounded, infinite scrolling list, or a very large but countable list. Use `https://developer.android.com/reference/androidx/paging/PagedList.Config` to control how many items a `https://developer.android.com/reference/androidx/paging/PagedList` loads, and when.

If you use `https://developer.android.com/reference/androidx/paging/LivePagedListBuilder` to get a `https://developer.android.com/reference/androidx/lifecycle/LiveData`, it will initialize `https://developer.android.com/reference/androidx/paging/PagedList`s on a background thread for you.

### Placeholders

There are two ways that `https://developer.android.com/reference/androidx/paging/PagedList` can represent its not-yet-loaded data - with or without `null` placeholders.

With placeholders, the `https://developer.android.com/reference/androidx/paging/PagedList` is always the full size of the data set. `get(N)` returns the `N`th item in the data set, or `null` if it's not yet loaded.

Without `null` placeholders, the `https://developer.android.com/reference/androidx/paging/PagedList` is the sublist of data that has already been loaded. The size of the `https://developer.android.com/reference/androidx/paging/PagedList` is the number of currently loaded items, and `get(N)` returns the `N`th *loaded* item. This is not necessarily the `N`th item in the data set.

Placeholders have several benefits:

- They express the full sized list to the presentation layer (often a `https://developer.android.com/reference/androidx/paging/PagedListAdapter`), and so can support scrollbars (without jumping as pages are loaded or dropped) and fast-scrolling to any position, loaded or not.

- They avoid the need for a loading spinner at the end of the loaded list, since the list is always full sized.

They also have drawbacks:

- Your Adapter needs to account for `null` items. This often means providing default values in data you bind to a `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder`.

- They don't work well if your item views are of different sizes, as this will prevent loading items from cross-fading nicely.

- They require you to count your data set, which can be expensive or impossible, depending on your `https://developer.android.com/reference/androidx/paging/PagingSource`.

Placeholders are enabled by default, but can be disabled in two ways. They are disabled if the `https://developer.android.com/reference/androidx/paging/PagingSource` does not count its data set in its initial load, or if `false` is passed to `https://developer.android.com/reference/androidx/paging/PagedList.Config.Builder#setEnablePlaceholders(kotlin.Boolean)` when building a `https://developer.android.com/reference/androidx/paging/PagedList.Config`.

### Mutability and Snapshots

A `https://developer.android.com/reference/androidx/paging/PagedList` is *mutable* while loading, or ready to load from its `https://developer.android.com/reference/androidx/paging/PagingSource`. As loads succeed, a mutable `https://developer.android.com/reference/androidx/paging/PagedList` will be updated via Runnables on the main thread. You can listen to these updates with a `https://developer.android.com/reference/androidx/paging/PagedList.Callback`. (Note that androidx.paging .PagedListAdapter will listen to these to signal RecyclerView about the updates/changes).

If a `https://developer.android.com/reference/androidx/paging/PagedList` attempts to load from an invalid `https://developer.android.com/reference/androidx/paging/PagingSource`, it will `https://developer.android.com/reference/androidx/paging/PagedList#detach()` from the `https://developer.android.com/reference/androidx/paging/PagingSource`, meaning that it will no longer attempt to load data. It will return true from `https://developer.android.com/reference/androidx/paging/PagedList#isImmutable()`, and a new `https://developer.android.com/reference/androidx/paging/PagingSource` / `https://developer.android.com/reference/androidx/paging/PagedList` pair must be created to load further data.

See `https://developer.android.com/reference/androidx/paging/PagingSource` and `https://developer.android.com/reference/androidx/paging/LivePagedListBuilder` for how new `https://developer.android.com/reference/androidx/paging/PagedList`s are created to represent changed data.

A `https://developer.android.com/reference/androidx/paging/PagedList` snapshot is simply an immutable shallow copy of the current state of the `https://developer.android.com/reference/androidx/paging/PagedList` as a `List`. It will reference the same inner items, and contain the same `null` placeholders, if present.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | The type of the entries in the list. |

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/annotation/MainThread public abstract class https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<T extends https://developer.android.com/reference/java/lang/Object.html>` **This class is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `public final class https://developer.android.com/reference/androidx/paging/PagedList.Builder<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html>` **This class is deprecated.** PagedList is deprecated and has been replaced by PagingData, which no longer supports constructing snapshots of loaded data manually. |
| `public abstract class https://developer.android.com/reference/androidx/paging/PagedList.Callback` **This class is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `public final class https://developer.android.com/reference/androidx/paging/PagedList.Config` **This class is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `public final class https://developer.android.com/reference/androidx/paging/PagedList.Config.Builder` **This class is deprecated.** PagedList is deprecated and has been replaced by PagingData |

| ### Public methods |
|---|---|
| `final void` | `[addWeakCallback](https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(androidx.paging.PagedList.Callback))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Callback callback)` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final void` | `[addWeakCallback](https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(kotlin.collections.List,androidx.paging.PagedList.Callback))( https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> previousSnapshot, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Callback callback )` **This method is deprecated.** Dispatching a diff since snapshot created is behavior that can be instead tracked by attaching a Callback to the PagedList that is mutating, and tracking changes since calling PagedList.snapshot(). |
| `final void` | `[addWeakLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedList#addWeakLoadStateListener(kotlin.Function2))( @https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadState, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> listener )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `abstract void` | `[detach](https://developer.android.com/reference/androidx/paging/PagedList#detach())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `T` | `[get](https://developer.android.com/reference/androidx/paging/PagedList#get(kotlin.Int))(int index)` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config` | `[getConfig](https://developer.android.com/reference/androidx/paging/PagedList#getConfig())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource<@https://developer.android.com/reference/androidx/annotation/NonNull ?, @https://developer.android.com/reference/androidx/annotation/NonNull T>` | `[getDataSource](https://developer.android.com/reference/androidx/paging/PagedList#getDataSource())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `abstract https://developer.android.com/reference/java/lang/Object.html` | `[getLastKey](https://developer.android.com/reference/androidx/paging/PagedList#getLastKey())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final int` | `[getLoadedCount](https://developer.android.com/reference/androidx/paging/PagedList#getLoadedCount())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final int` | `[getPositionOffset](https://developer.android.com/reference/androidx/paging/PagedList#getPositionOffset())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `int` | `[getSize](https://developer.android.com/reference/androidx/paging/PagedList#getSize())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `abstract boolean` | `[isDetached](https://developer.android.com/reference/androidx/paging/PagedList#isDetached())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `boolean` | `[isImmutable](https://developer.android.com/reference/androidx/paging/PagedList#isImmutable())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final void` | `[loadAround](https://developer.android.com/reference/androidx/paging/PagedList#loadAround(kotlin.Int))(int index)` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final void` | `[removeWeakCallback](https://developer.android.com/reference/androidx/paging/PagedList#removeWeakCallback(androidx.paging.PagedList.Callback))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Callback callback)` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final void` | `[removeWeakLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedList#removeWeakLoadStateListener(kotlin.Function2))( @https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadState, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> listener )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `void` | `[retry](https://developer.android.com/reference/androidx/paging/PagedList#retry())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | `[snapshot](https://developer.android.com/reference/androidx/paging/PagedList#snapshot())()` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |

### Inherited fields

From [java.util.AbstractList](https://developer.android.com/reference/java/util/AbstractList.html) `final int` `https://developer.android.com/reference/java/util/AbstractList.html#modCount`

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

### Inherited methods

From [java.util.AbstractCollection](https://developer.android.com/reference/java/util/AbstractCollection.html) `boolean` `[addAll](https://developer.android.com/reference/java/util/AbstractCollection.html#addAll(java.util.Collection&lt;? extends E&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> c)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[contains](https://developer.android.com/reference/java/util/AbstractCollection.html#contains(java.lang.Object))(@https://developer.android.com/reference/androidx/annotation/RecentlyNullable @https://developer.android.com/reference/androidx/annotation/NonNull T o)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[containsAll](https://developer.android.com/reference/java/util/AbstractCollection.html#containsAll(java.util.Collection&lt;?&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> c)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[isEmpty](https://developer.android.com/reference/java/util/AbstractCollection.html#isEmpty())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[remove](https://developer.android.com/reference/java/util/AbstractCollection.html#remove(java.lang.Object))(@https://developer.android.com/reference/androidx/annotation/RecentlyNullable @https://developer.android.com/reference/androidx/annotation/NonNull T o)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[removeAll](https://developer.android.com/reference/java/util/AbstractCollection.html#removeAll(java.util.Collection&lt;?&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> c)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[retainAll](https://developer.android.com/reference/java/util/AbstractCollection.html#retainAll(java.util.Collection&lt;?&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> c)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull Object[]` `[toArray](https://developer.android.com/reference/java/util/AbstractCollection.html#toArray())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull T[]` `<T extends https://developer.android.com/reference/java/lang/Object.html> [toArray](https://developer.android.com/reference/java/util/AbstractCollection.html#toArray(T[]))(@https://developer.android.com/reference/androidx/annotation/NonNull T[] a)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[toString](https://developer.android.com/reference/java/util/AbstractCollection.html#toString())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
From [java.util.AbstractList](https://developer.android.com/reference/java/util/AbstractList.html) `boolean` `[add](https://developer.android.com/reference/java/util/AbstractList.html#add(E))(@https://developer.android.com/reference/androidx/annotation/NonNull T e)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`void` `[add](https://developer.android.com/reference/java/util/AbstractList.html#add(int, E))(int index, @https://developer.android.com/reference/androidx/annotation/NonNull T element)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[addAll](https://developer.android.com/reference/java/util/AbstractList.html#addAll(int, java.util.Collection&lt;? extends E&gt;))(int index, @https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> c)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`void` `[clear](https://developer.android.com/reference/java/util/AbstractList.html#clear())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`boolean` `[equals](https://developer.android.com/reference/java/util/AbstractList.html#equals(java.lang.Object))(https://developer.android.com/reference/java/lang/Object.html o)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`int` `[hashCode](https://developer.android.com/reference/java/util/AbstractList.html#hashCode())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`int` `[indexOf](https://developer.android.com/reference/java/util/AbstractList.html#indexOf(java.lang.Object))(@https://developer.android.com/reference/androidx/annotation/RecentlyNullable @https://developer.android.com/reference/androidx/annotation/NonNull T o)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Iterator.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[iterator](https://developer.android.com/reference/java/util/AbstractList.html#iterator())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`int` `[lastIndexOf](https://developer.android.com/reference/java/util/AbstractList.html#lastIndexOf(java.lang.Object))(@https://developer.android.com/reference/androidx/annotation/RecentlyNullable @https://developer.android.com/reference/androidx/annotation/NonNull T o)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/ListIterator.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[listIterator](https://developer.android.com/reference/java/util/AbstractList.html#listIterator())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/ListIterator.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[listIterator](https://developer.android.com/reference/java/util/AbstractList.html#listIterator(int))(int index)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull T` `[removeAt](https://developer.android.com/reference/java/util/AbstractList.html#removeAt(int))(int index)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`void` `[removeRange](https://developer.android.com/reference/java/util/AbstractList.html#removeRange(int, int))(int fromIndex, int toIndex)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull T` `[set](https://developer.android.com/reference/java/util/AbstractList.html#set(int, E))(int index, @https://developer.android.com/reference/androidx/annotation/NonNull T element)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[subList](https://developer.android.com/reference/java/util/AbstractList.html#subList(int, int))(int fromIndex, int toIndex)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
From [kotlin.collections.Collection](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html) `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/stream/Stream.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[parallelStream](https://developer.android.com/reference/java/util/Collection.html#parallelStream())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Spliterator.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[spliterator](https://developer.android.com/reference/java/util/Collection.html#spliterator())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/stream/Stream.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[stream](https://developer.android.com/reference/java/util/Collection.html#stream())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull T[]` `<T extends https://developer.android.com/reference/java/lang/Object.html> [toArray](https://developer.android.com/reference/java/util/Collection.html#toArray(java.util.function.IntFunction&lt;T[]&gt;))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/function/IntFunction.html<@https://developer.android.com/reference/androidx/annotation/NonNull T[]> generator)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
From [kotlin.collections.Iterable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html) `void` `[forEach](https://developer.android.com/reference/java/lang/Iterable.html#forEach(java.util.function.Consumer&lt;? super T&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/function/Consumer.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> action)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
From [kotlin.collections.List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html) `@https://developer.android.com/reference/androidx/annotation/NonNull T` `[getFirst](https://developer.android.com/reference/java/util/List.html#getFirst())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull T` `[getLast](https://developer.android.com/reference/java/util/List.html#getLast())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[reversed](https://developer.android.com/reference/java/util/List.html#reversed())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
From [kotlin.collections.MutableCollection](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html) `boolean` `[removeIf](https://developer.android.com/reference/java/util/Collection.html#removeIf(java.util.function.Predicate&lt;? super E&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/function/Predicate.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> filter)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
From [kotlin.collections.MutableList](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html) `void` `[addFirst](https://developer.android.com/reference/java/util/List.html#addFirst(E))(@https://developer.android.com/reference/androidx/annotation/NonNull T e)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`void` `[addLast](https://developer.android.com/reference/java/util/List.html#addLast(E))(@https://developer.android.com/reference/androidx/annotation/NonNull T e)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull T` `[removeFirst](https://developer.android.com/reference/java/util/List.html#removeFirst())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`@https://developer.android.com/reference/androidx/annotation/NonNull T` `[removeLast](https://developer.android.com/reference/java/util/List.html#removeLast())()`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`void` `[replaceAll](https://developer.android.com/reference/java/util/List.html#replaceAll(java.util.function.UnaryOperator&lt;E&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/function/UnaryOperator.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> operator)`

**This method is deprecated.** PagedList is deprecated and has been replaced by PagingData
`void` `[sort](https://developer.android.com/reference/java/util/List.html#sort(java.util.Comparator&lt;? super E&gt;))(@https://developer.android.com/reference/androidx/annotation/RecentlyNullable @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Comparator.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> c)`

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

## Public methods

### addWeakCallback

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

```
public final void [addWeakCallback](https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(androidx.paging.PagedList.Callback))(@NonNull PagedList.Callback callback)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Adds a callback.

The callback is internally held as weak reference, so `https://developer.android.com/reference/androidx/paging/PagedList` doesn't hold a strong reference to its observer, such as a `https://developer.android.com/reference/androidx/paging/PagedListAdapter`. If an adapter were held with a strong reference, it would be necessary to clear its `https://developer.android.com/reference/androidx/paging/PagedList` observer before it could be GC'd.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Callback callback` | Callback to dispatch to. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#removeWeakCallback(androidx.paging.PagedList.Callback)` |   |

### addWeakCallback

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

```
public final void [addWeakCallback](https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(kotlin.collections.List,androidx.paging.PagedList.Callback))(
    List<@NonNull T> previousSnapshot,
    @NonNull PagedList.Callback callback
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Dispatching a diff since snapshot created is behavior that can be instead tracked by attaching a Callback to the PagedList that is mutating, and tracking changes since calling PagedList.snapshot().

Adds a callback, and issues updates since the `https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(kotlin.collections.List,androidx.paging.PagedList.Callback)` was created.

If `https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(kotlin.collections.List,androidx.paging.PagedList.Callback)` is passed, the `https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(kotlin.collections.List,androidx.paging.PagedList.Callback)` will also immediately be dispatched any differences between the previous snapshot, and the current state. For example, if the previousSnapshot was of 5 nulls, 10 items, 5 nulls, and the current state was 5 nulls, 12 items, 3 nulls, the callback would immediately receive a call of`onChanged(14, 2)`.

This allows an observer that's currently presenting a snapshot to catch up to the most recent version, including any changes that may have been made.

The callback is internally held as weak reference, so `https://developer.android.com/reference/androidx/paging/PagedList` doesn't hold a strong reference to its observer, such as a `https://developer.android.com/reference/androidx/paging/PagedListAdapter`. If an adapter were held with a strong reference, it would be necessary to clear its `https://developer.android.com/reference/androidx/paging/PagedList` observer before it could be GC'd.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> previousSnapshot` | Snapshot previously captured from this List, or `null`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Callback callback` | `https://developer.android.com/reference/androidx/paging/PagedList.Callback` to dispatch to. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#removeWeakCallback(androidx.paging.PagedList.Callback)` |   |

### addWeakLoadStateListener

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

```
public final void [addWeakLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedList#addWeakLoadStateListener(kotlin.Function2))(
    @NonNull Function2<@NonNull LoadType, @NonNull LoadState, Unit> listener
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Add a listener to observe the loading state of the `https://developer.android.com/reference/androidx/paging/PagedList`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadState, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> listener` | Listener to receive updates. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#removeWeakLoadStateListener(kotlin.Function2)` |   |

### detach

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)

```
public abstract void [detach](https://developer.android.com/reference/androidx/paging/PagedList#detach())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Detach the `https://developer.android.com/reference/androidx/paging/PagedList` from its `https://developer.android.com/reference/androidx/paging/PagingSource`, and attempt to load no more data.

This is called automatically when a `https://developer.android.com/reference/androidx/paging/PagingSource` is observed to be invalid, which is a signal to stop loading. The `https://developer.android.com/reference/androidx/paging/PagedList` will continue to present existing data, but will not initiate new loads.

### get

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)

```
public T [get](https://developer.android.com/reference/androidx/paging/PagedList#get(kotlin.Int))(int index)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Get the item in the list of loaded items at the provided index.

| Parameters |
|---|---|
| `int index` | Index in the loaded item list. Must be \>= 0, and \<`https://developer.android.com/reference/androidx/paging/PagedList#size()` |

| Returns |
|---|---|
| `T` | The item at the passed index, or `null` if a `null` placeholder is at the specified position. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#size()` |   |

### getConfig

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)

```
public final @NonNull PagedList.Config [getConfig](https://developer.android.com/reference/androidx/paging/PagedList#getConfig())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Return the Config used to construct this PagedList.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config` | the Config of this PagedList |

### getDataSource

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)

```
public final @NonNull DataSource<@NonNull ?, @NonNull T> [getDataSource](https://developer.android.com/reference/androidx/paging/PagedList#getDataSource())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this `https://developer.android.com/reference/androidx/paging/PagedList` was instantiated without a wrapping a backing `https://developer.android.com/reference/androidx/paging/DataSource` |

### getLastKey

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)

```
public abstract Object [getLastKey](https://developer.android.com/reference/androidx/paging/PagedList#getLastKey())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Return the key for the position passed most recently to `https://developer.android.com/reference/androidx/paging/PagedList#loadAround(kotlin.Int)`.

When a PagedList is invalidated, you can pass the key returned by this function to initialize the next PagedList. This ensures (depending on load times) that the next PagedList that arrives will have data that overlaps. If you use androidx.paging.LivePagedListBuilder, it will do this for you.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html` | Key of position most recently passed to `https://developer.android.com/reference/androidx/paging/PagedList#loadAround(kotlin.Int)`. |

### getLoadedCount

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

```
public final int [getLoadedCount](https://developer.android.com/reference/androidx/paging/PagedList#getLoadedCount())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Returns the number of items loaded in the `https://developer.android.com/reference/androidx/paging/PagedList`.

Unlike `https://developer.android.com/reference/androidx/paging/PagedList#size()` this counts only loaded items, not placeholders.

If placeholders are `https://developer.android.com/reference/androidx/paging/PagedList.Config#enablePlaceholders()`, this method is equivalent to `https://developer.android.com/reference/androidx/paging/PagedList#size()`.

| Returns |
|---|---|
| `int` | Number of items currently loaded, not counting placeholders. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#size()` |   |

### getPositionOffset

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)

```
public final int [getPositionOffset](https://developer.android.com/reference/androidx/paging/PagedList#getPositionOffset())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Position offset of the data in the list.

If the PagingSource backing this PagedList is counted, the item returned from `get(i)` has a position in the original data set of `i + getPositionOffset()`.

If placeholders are enabled, this value is always `0`, since `get(i)` will return either the data in its original index, or null if it is not loaded.

### getSize

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

```
public int [getSize](https://developer.android.com/reference/androidx/paging/PagedList#getSize())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Size of the list, including any placeholders (not-yet-loaded null padding).

To get the number of loaded items, not counting placeholders, use `https://developer.android.com/reference/androidx/paging/PagedList#loadedCount()`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#loadedCount()` |   |

### isDetached

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)

```
public abstract boolean [isDetached](https://developer.android.com/reference/androidx/paging/PagedList#isDetached())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

True if the `https://developer.android.com/reference/androidx/paging/PagedList` has detached the `https://developer.android.com/reference/androidx/paging/PagingSource` it was loading from, and will no longer load new data.

A detached list is `https://developer.android.com/reference/androidx/paging/PagedList#isImmutable()`.

| Returns |
|---|---|
| `boolean` | `true` if the data source is detached. |

### isImmutable

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)

```
public boolean [isImmutable](https://developer.android.com/reference/androidx/paging/PagedList#isImmutable())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Returns whether the list is immutable.

Immutable lists may not become mutable again, and may safely be accessed from any thread.

In the future, this method may return true when a PagedList has completed loading from its `https://developer.android.com/reference/androidx/paging/PagingSource`. Currently, it is equivalent to `https://developer.android.com/reference/androidx/paging/PagedList#isDetached()`.

| Returns |
|---|---|
| `boolean` | `true` if the `https://developer.android.com/reference/androidx/paging/PagedList` is immutable. |

### loadAround

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)

```
public final void [loadAround](https://developer.android.com/reference/androidx/paging/PagedList#loadAround(kotlin.Int))(int index)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Load adjacent items to passed index.

| Parameters |
|---|---|
| `int index` | Index at which to load. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if index is not within bounds. |

### removeWeakCallback

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)

```
public final void [removeWeakCallback](https://developer.android.com/reference/androidx/paging/PagedList#removeWeakCallback(androidx.paging.PagedList.Callback))(@NonNull PagedList.Callback callback)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Removes a previously added callback.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Callback callback` | Callback, previously added. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#addWeakCallback(kotlin.collections.List,androidx.paging.PagedList.Callback)` |   |

### removeWeakLoadStateListener

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

```
public final void [removeWeakLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedList#removeWeakLoadStateListener(kotlin.Function2))(
    @NonNull Function2<@NonNull LoadType, @NonNull LoadState, Unit> listener
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Remove a previously registered load state listener.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function2<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadState, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> listener` | Previously registered listener. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#addWeakLoadStateListener(kotlin.Function2)` |   |

### retry

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

```
public void [retry](https://developer.android.com/reference/androidx/paging/PagedList#retry())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Retry any errors associated with this `https://developer.android.com/reference/androidx/paging/PagedList`.

If for example a network `https://developer.android.com/reference/androidx/paging/PagingSource` append timed out, calling this method will retry the failed append load.

You can observe loading state via `https://developer.android.com/reference/androidx/paging/PagedList#addWeakLoadStateListener(kotlin.Function2)`, though generally this is done through the `https://developer.android.com/reference/androidx/paging/PagedListAdapter` or `https://developer.android.com/reference/androidx/paging/AsyncPagedListDiffer`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList#addWeakLoadStateListener(kotlin.Function2)` |   |
| `https://developer.android.com/reference/androidx/paging/PagedList#removeWeakLoadStateListener(kotlin.Function2)` |   |

### snapshot

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)

```
public final @NonNull List<@NonNull T> [snapshot](https://developer.android.com/reference/androidx/paging/PagedList#snapshot())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Returns an immutable snapshot of the `https://developer.android.com/reference/androidx/paging/PagedList` in its current state.

If this is immutable`https://developer.android.com/reference/androidx/paging/PagedList#isImmutable()` due to its `https://developer.android.com/reference/androidx/paging/PagingSource` being invalid, it will be returned.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | Immutable snapshot of `https://developer.android.com/reference/androidx/paging/PagedList` data. |