# PagedListAdapter

Artifact: [androidx.paging:paging-runtime](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/PagedListAdapter.kt+class:androidx.paging.PagedListAdapter) 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 PagedListAdapter<T extends Object, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<@NonNull VH>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.recyclerview.widget.RecyclerView.Adapter](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) VH\> ||
|   | ↳ | [androidx.paging.PagedListAdapter](https://developer.android.com/reference/androidx/paging/PagedListAdapter) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

`https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter` base class for presenting paged data from `https://developer.android.com/reference/androidx/paging/PagedList`s in a `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView`.

This class is a convenience wrapper around `https://developer.android.com/reference/androidx/paging/AsyncPagedListDiffer` that implements common default behavior for item counting, and listening to PagedList update callbacks.

While using a LiveData is an easy way to provide data to the adapter, it isn't required - you can use `https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList)` when new lists are available.

PagedListAdapter listens to PagedList loading callbacks as pages are loaded, and uses DiffUtil on a background thread to compute fine grained updates as new PagedLists are received.

Handles both the internal paging of the list as more data is loaded, and updates in the form of new PagedLists.

A complete usage pattern with Room would look like this:

```
@Dao
interface UserDao {
    @Query("SELECT * FROM user ORDER BY lastName ASC")
    public abstract DataSource.Factory<Integer, User> usersByLastName();
}

class MyViewModel extends ViewModel {
    public final LiveData<PagedList<User>> usersList;
    public MyViewModel(UserDao userDao) {
        usersList = new LivePagedListBuilder&lt;>(
        userDao.usersByLastName(), /* page size */20).build();
    }
}

class MyActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedState) {
        super.onCreate(savedState);
        MyViewModel viewModel = new ViewModelProvider(this).get(MyViewModel.class);
        RecyclerView recyclerView = findViewById(R.id.user_list);
        UserAdapter&lt;User> adapter = new UserAdapter();
        viewModel.usersList.observe(this, pagedList -> adapter.submitList(pagedList));
        recyclerView.setAdapter(adapter);
    }
}

class UserAdapter extends PagedListAdapter<User, UserViewHolder> {
    public UserAdapter() {
        super(DIFF_CALLBACK);
    }
    @Override
    public void onBindViewHolder(UserViewHolder holder, int position) {
        User user = getItem(position);
        if (user != null) {
            holder.bindTo(user);
        } else {
            // Null defines a placeholder item - PagedListAdapter will automatically invalidate
            // this row when the actual object is loaded from the database
            holder.clear();
        }
    }
    public static final DiffUtil.ItemCallback&lt;User> DIFF_CALLBACK =
            new DiffUtil.ItemCallback<User>() {
        @Override
        public boolean areItemsTheSame(@NonNull User oldUser, @NonNull User newUser) {
            // User properties may have changed if reloaded from the DB, but ID is fixed
            return oldUser.getId() == newUser.getId();
        }
        @Override
        public boolean areContentsTheSame(@NonNull User oldUser, @NonNull User newUser) {
            // NOTE: if you use equals, your object must properly override Object#equals()
            // Incorrectly returning false here will result in too many animations.
            return oldUser.equals(newUser);
        }
    }
}
```

Advanced users that wish for more control over adapter behavior, or to provide a specific base class should refer to `https://developer.android.com/reference/androidx/paging/AsyncPagedListDiffer`, which provides the mapping from paging events to adapter-friendly callbacks.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | Type of the PagedLists this Adapter will receive. |
| `<VH extends https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder>` | A class that extends ViewHolder that will be used by the adapter. |

## Summary

| ### Protected constructors |
|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html, VH extends https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder> [PagedListAdapter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#PagedListAdapter(androidx.recyclerview.widget.AsyncDifferConfig))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/AsyncDifferConfig<@https://developer.android.com/reference/androidx/annotation/NonNull T> config )` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `<T extends https://developer.android.com/reference/java/lang/Object.html, VH extends https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder> [PagedListAdapter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#PagedListAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil.ItemCallback<@https://developer.android.com/reference/androidx/annotation/NonNull T> diffCallback )` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |

| ### Public methods |
|---|---|
| `void` | `[addLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedListAdapter#addLoadStateListener(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.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | `[getCurrentList](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getCurrentList())()` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `int` | `[getItemCount](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getItemCount())()` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `int` | `[getItemCount](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getItemCount())()` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter.StateRestorationPolicy` | `[getStateRestorationPolicy](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getStateRestorationPolicy())()` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `void` | `[onCurrentListChanged](https://developer.android.com/reference/androidx/paging/PagedListAdapter#onCurrentListChanged(androidx.paging.PagedList))(https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> currentList)` **This method is deprecated.** Use the two argument variant instead. |
| `void` | `[onCurrentListChanged](https://developer.android.com/reference/androidx/paging/PagedListAdapter#onCurrentListChanged(androidx.paging.PagedList,androidx.paging.PagedList))( https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> previousList, https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> currentList )` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `void` | `[removeLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedListAdapter#removeLoadStateListener(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.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `void` | `[setStateRestorationPolicy](https://developer.android.com/reference/androidx/paging/PagedListAdapter#setStateRestorationPolicy(androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter.StateRestorationPolicy strategy )` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `void` | `[submitList](https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList))(https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> pagedList)` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `void` | `[submitList](https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList,java.lang.Runnable))(https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> pagedList, https://developer.android.com/reference/java/lang/Runnable.html commitCallback)` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter` | `[withLoadStateFooter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#withLoadStateFooter(androidx.paging.LoadStateAdapter))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadStateAdapter<@https://developer.android.com/reference/androidx/annotation/NonNull ?> footer)` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter` | `[withLoadStateHeader](https://developer.android.com/reference/androidx/paging/PagedListAdapter#withLoadStateHeader(androidx.paging.LoadStateAdapter))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadStateAdapter<@https://developer.android.com/reference/androidx/annotation/NonNull ?> header)` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter` | `[withLoadStateHeaderAndFooter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#withLoadStateHeaderAndFooter(androidx.paging.LoadStateAdapter,androidx.paging.LoadStateAdapter))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadStateAdapter<@https://developer.android.com/reference/androidx/annotation/NonNull ?> header, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/LoadStateAdapter<@https://developer.android.com/reference/androidx/annotation/NonNull ?> footer )` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |

| ### Protected methods |
|---|---|
| `T` | `[getItem](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getItem(kotlin.Int))(int position)` **This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter |

### Inherited methods

From [androidx.recyclerview.widget.RecyclerView.Adapter](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter) `final void` `[bindViewHolder](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#bindViewHolder(VH,int))(@https://developer.android.com/reference/androidx/annotation/NonNull VH holder, int position)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final @https://developer.android.com/reference/androidx/annotation/NonNull VH` `[createViewHolder](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#createViewHolder(android.view.ViewGroup,int))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/ViewGroup.html parent, int viewType)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`int` `[findRelativeAdapterPositionIn](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#findRelativeAdapterPositionIn(androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>,androidx.recyclerview.widget.RecyclerView.ViewHolder,int))(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder> adapter,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder viewHolder,
int localPosition
)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`long` `[getItemId](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#getItemId(int))(int position)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`int` `[getItemViewType](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#getItemViewType(int))(int position)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final boolean` `[hasObservers](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#hasObservers())()`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final boolean` `[hasStableIds](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#hasStableIds())()`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyDataSetChanged](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyDataSetChanged())()`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemChanged](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemChanged(int))(int position)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemChanged](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemChanged(int,java.lang.Object))(int position, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html payload)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemInserted](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemInserted(int))(int position)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemMoved](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemMoved(int,int))(int fromPosition, int toPosition)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemRangeChanged](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemRangeChanged(int,int))(int positionStart, int itemCount)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemRangeChanged](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemRangeChanged(int,int,java.lang.Object))(
int positionStart,
int itemCount,
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html payload
)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemRangeInserted](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemRangeInserted(int,int))(int positionStart, int itemCount)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemRangeRemoved](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemRangeRemoved(int,int))(int positionStart, int itemCount)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`final void` `[notifyItemRemoved](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemRemoved(int))(int position)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[onAttachedToRecyclerView](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onAttachedToRecyclerView(androidx.recyclerview.widget.RecyclerView))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView recyclerView)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`abstract void` `[onBindViewHolder](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onBindViewHolder(VH,int))(@https://developer.android.com/reference/androidx/annotation/NonNull VH holder, int position)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[onBindViewHolder](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onBindViewHolder(VH,int,java.util.List<java.lang.Object>))(
@https://developer.android.com/reference/androidx/annotation/NonNull VH holder,
int position,
@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 https://developer.android.com/reference/java/lang/Object.html> payloads
)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`abstract @https://developer.android.com/reference/androidx/annotation/NonNull VH` `[onCreateViewHolder](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onCreateViewHolder(android.view.ViewGroup,int))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/ViewGroup.html parent, int viewType)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[onDetachedFromRecyclerView](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onDetachedFromRecyclerView(androidx.recyclerview.widget.RecyclerView))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView recyclerView)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`boolean` `[onFailedToRecycleView](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onFailedToRecycleView(VH))(@https://developer.android.com/reference/androidx/annotation/NonNull VH holder)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[onViewAttachedToWindow](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onViewAttachedToWindow(VH))(@https://developer.android.com/reference/androidx/annotation/NonNull VH holder)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[onViewDetachedFromWindow](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onViewDetachedFromWindow(VH))(@https://developer.android.com/reference/androidx/annotation/NonNull VH holder)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[onViewRecycled](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onViewRecycled(VH))(@https://developer.android.com/reference/androidx/annotation/NonNull VH holder)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[registerAdapterDataObserver](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#registerAdapterDataObserver(androidx.recyclerview.widget.RecyclerView.AdapterDataObserver))(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.AdapterDataObserver observer
)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[setHasStableIds](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#setHasStableIds(boolean))(boolean hasStableIds)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter
`void` `[unregisterAdapterDataObserver](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#unregisterAdapterDataObserver(androidx.recyclerview.widget.RecyclerView.AdapterDataObserver))(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.AdapterDataObserver observer
)`

**This method is deprecated.** PagedListAdapter is deprecated and has been replaced by PagingDataAdapter

## Protected constructors

### PagedListAdapter

```
protected <T extends Object, VH extends RecyclerView.ViewHolder> [PagedListAdapter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#PagedListAdapter(androidx.recyclerview.widget.AsyncDifferConfig))(
    @NonNull AsyncDifferConfig<@NonNull T> config
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

### PagedListAdapter

```
protected <T extends Object, VH extends RecyclerView.ViewHolder> [PagedListAdapter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#PagedListAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback))(
    @NonNull DiffUtil.ItemCallback<@NonNull T> diffCallback
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Creates a `https://developer.android.com/reference/androidx/paging/PagedListAdapter` with default threading and `https://developer.android.com/reference/androidx/recyclerview/widget/ListUpdateCallback`.

Convenience for `https://developer.android.com/reference/androidx/paging/PagedListAdapter`, which uses default threading behavior.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil.ItemCallback<@https://developer.android.com/reference/androidx/annotation/NonNull T> diffCallback` | The `https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil.ItemCallback` instance to compare items in the list. |

## Public methods

### addLoadStateListener

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 [addLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedListAdapter#addLoadStateListener(kotlin.Function2))(
    @NonNull Function2<@NonNull LoadType, @NonNull LoadState, Unit> listener
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

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

As new PagedLists are submitted and displayed, the listener will be notified to reflect current `https://developer.android.com/reference/androidx/paging/LoadType#REFRESH`, `https://developer.android.com/reference/androidx/paging/LoadType#PREPEND`, and `https://developer.android.com/reference/androidx/paging/LoadType#APPEND` states.

| 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 `https://developer.android.com/reference/androidx/paging/LoadState` updates. |

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

### getCurrentList

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 PagedList<@NonNull T> [getCurrentList](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getCurrentList())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Returns the `https://developer.android.com/reference/androidx/paging/PagedList` currently being displayed by the `https://developer.android.com/reference/androidx/paging/PagedListAdapter`.

This is not necessarily the most recent list passed to `https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList)`, because a diff is computed asynchronously between the new list and the current list before updating the currentList value. May be null if no PagedList is being presented.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | The list currently being displayed. |

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

### getItemCount

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 int [getItemCount](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getItemCount())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Returns the total number of items in the data set held by the adapter.

| Returns |
|---|---|
| `int` | The total number of items in this adapter. |

### getItemCount

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 int [getItemCount](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getItemCount())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

### getStateRestorationPolicy

```
public final @NonNull RecyclerView.Adapter.StateRestorationPolicy [getStateRestorationPolicy](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getStateRestorationPolicy())()
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

### onCurrentListChanged

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

```
public void [onCurrentListChanged](https://developer.android.com/reference/androidx/paging/PagedListAdapter#onCurrentListChanged(androidx.paging.PagedList))(PagedList<@NonNull T> currentList)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use the two argument variant instead, use this instead:
>
> ```
> onCurrentListChanged(previousList, currentList)
> ```

Called when the current PagedList is updated.

This may be dispatched as part of `https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList)` if a background diff isn't needed (such as when the first list is passed, or the list is cleared). In either case, PagedListAdapter will simply call `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemRangeInserted(int,int)`.

This method will *not*be called when the Adapter switches from presenting a PagedList to a snapshot version of the PagedList during a diff. This means you cannot observe each PagedList via this method.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> currentList` | new PagedList being displayed, may be null. |

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

### onCurrentListChanged

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 void [onCurrentListChanged](https://developer.android.com/reference/androidx/paging/PagedListAdapter#onCurrentListChanged(androidx.paging.PagedList,androidx.paging.PagedList))(
    PagedList<@NonNull T> previousList,
    PagedList<@NonNull T> currentList
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Called when the current PagedList is updated.

This may be dispatched as part of `https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList)` if a background diff isn't needed (such as when the first list is passed, or the list is cleared). In either case, PagedListAdapter will simply call `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#notifyItemRangeInserted(int,int)`.

This method will *not*be called when the Adapter switches from presenting a PagedList to a snapshot version of the PagedList during a diff. This means you cannot observe each PagedList via this method.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> previousList` | `https://developer.android.com/reference/androidx/paging/PagedList` that was previously displayed, may be null. |
| `https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> currentList` | new `https://developer.android.com/reference/androidx/paging/PagedList` being displayed, may be null. |

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

### removeLoadStateListener

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 [removeLoadStateListener](https://developer.android.com/reference/androidx/paging/PagedListAdapter#removeLoadStateListener(kotlin.Function2))(
    @NonNull Function2<@NonNull LoadType, @NonNull LoadState, Unit> listener
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Remove a previously registered `https://developer.android.com/reference/androidx/paging/LoadState` 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/PagedListAdapter#addLoadStateListener(kotlin.Function2)` |   |

### setStateRestorationPolicy

```
public void [setStateRestorationPolicy](https://developer.android.com/reference/androidx/paging/PagedListAdapter#setStateRestorationPolicy(androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy))(
    @NonNull RecyclerView.Adapter.StateRestorationPolicy strategy
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

### submitList

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 void [submitList](https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList))(PagedList<@NonNull T> pagedList)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Set the new list to be displayed.

If a list is already being displayed, a diff will be computed on a background thread, which will dispatch Adapter.notifyItem events on the main thread.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> pagedList` | The new list to be displayed. |

### submitList

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 void [submitList](https://developer.android.com/reference/androidx/paging/PagedListAdapter#submitList(androidx.paging.PagedList,java.lang.Runnable))(PagedList<@NonNull T> pagedList, Runnable commitCallback)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Set the new list to be displayed.

If a list is already being displayed, a diff will be computed on a background thread, which will dispatch Adapter.notifyItem events on the main thread.

The commit callback can be used to know when the PagedList is committed, but note that it may not be executed. If PagedList B is submitted immediately after PagedList A, and is committed directly, the callback associated with PagedList A will not be run.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull T> pagedList` | The new list to be displayed. |
| `https://developer.android.com/reference/java/lang/Runnable.html commitCallback` | Optional runnable that is executed when the PagedList is committed, if it is committed. |

### withLoadStateFooter

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 @NonNull ConcatAdapter [withLoadStateFooter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#withLoadStateFooter(androidx.paging.LoadStateAdapter))(@NonNull LoadStateAdapter<@NonNull ?> footer)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Create a `https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter` with the provided `https://developer.android.com/reference/androidx/paging/LoadStateAdapter`s displaying the `https://developer.android.com/reference/androidx/paging/LoadState` as a list item at the start of the presented list.

### withLoadStateHeader

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 @NonNull ConcatAdapter [withLoadStateHeader](https://developer.android.com/reference/androidx/paging/PagedListAdapter#withLoadStateHeader(androidx.paging.LoadStateAdapter))(@NonNull LoadStateAdapter<@NonNull ?> header)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Create a `https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter` with the provided `https://developer.android.com/reference/androidx/paging/LoadStateAdapter`s displaying the `https://developer.android.com/reference/androidx/paging/LoadState` as a list item at the end of the presented list.

### withLoadStateHeaderAndFooter

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 @NonNull ConcatAdapter [withLoadStateHeaderAndFooter](https://developer.android.com/reference/androidx/paging/PagedListAdapter#withLoadStateHeaderAndFooter(androidx.paging.LoadStateAdapter,androidx.paging.LoadStateAdapter))(
    @NonNull LoadStateAdapter<@NonNull ?> header,
    @NonNull LoadStateAdapter<@NonNull ?> footer
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```

Create a `https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter` with the provided `https://developer.android.com/reference/androidx/paging/LoadStateAdapter`s displaying the `https://developer.android.com/reference/androidx/paging/LoadType#PREPEND` and `https://developer.android.com/reference/androidx/paging/LoadState`s as list items at the start and end respectively.

## Protected methods

### getItem

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)

```
protected T [getItem](https://developer.android.com/reference/androidx/paging/PagedListAdapter#getItem(kotlin.Int))(int position)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedListAdapter is deprecated and has been replaced by PagingDataAdapter, use this instead:
>
> ```
> PagingDataAdapter<T, VH>
> ```