Stay organized with collections
Save and categorize content based on your preferences.
PagedList.Callback
public
static
abstract
class
PagedList.Callback
extends Object
java.lang.Object
|
↳ |
android.arch.paging.PagedList.Callback
|
Callback signaling when content is loaded into the list.
Can be used to listen to items being paged in and out. These calls will be dispatched on
the executor defined by setNotifyExecutor(Executor)
, which is generally
the main/UI thread.
Summary
Public methods |
abstract
void
|
onChanged(int position, int count)
Called when null padding items have been loaded to signal newly available data, or when
data that hasn't been used in a while has been dropped, and swapped back to null.
|
abstract
void
|
onInserted(int position, int count)
Called when new items have been loaded at the end or beginning of the list.
|
abstract
void
|
onRemoved(int position, int count)
Called when items have been removed at the end or beginning of the list, and have not
been replaced by padded nulls.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
PagedList.Callback
PagedList.Callback ()
Public methods
onChanged
void onChanged (int position,
int count)
Called when null padding items have been loaded to signal newly available data, or when
data that hasn't been used in a while has been dropped, and swapped back to null.
Parameters |
position |
int : Position of first newly loaded items, out of total number of items
(including padded nulls). |
count |
int : Number of items loaded.
|
onInserted
void onInserted (int position,
int count)
Called when new items have been loaded at the end or beginning of the list.
Parameters |
position |
int : Position of the first newly loaded item (in practice, either
0 or size - 1 . |
count |
int : Number of items loaded.
|
onRemoved
void onRemoved (int position,
int count)
Called when items have been removed at the end or beginning of the list, and have not
been replaced by padded nulls.
Parameters |
position |
int : Position of the first newly loaded item (in practice, either
0 or size - 1 . |
count |
int : Number of items loaded.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PagedList.Callback\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nPagedList.Callback\n==================\n\n| The `android.arch` Architecture Components packages are no longer maintained. They have been superseded by the corresponding [androidx.\\*](/jetpack/androidx/migrate) packages. See [androidx.paging.PagedList.Callback](/reference/androidx/paging/PagedList.Callback) instead.\n\n\n`\npublic\nstatic\n\nabstract\nclass\nPagedList.Callback\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------|\n| java.lang.Object ||\n| ↳ | android.arch.paging.PagedList.Callback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nCallback signaling when content is loaded into the list.\n\n\nCan be used to listen to items being paged in and out. These calls will be dispatched on\nthe executor defined by [setNotifyExecutor(Executor)](/reference/android/arch/paging/PagedList.Builder#setNotifyExecutor(java.util.concurrent.Executor)), which is generally\nthe main/UI thread.\n\nSummary\n-------\n\n| ### Public constructors ||\n|------------------------------------------------------------------------------------------------------|---|\n| ` `[PagedList.Callback](/reference/android/arch/paging/PagedList.Callback#PagedList.Callback())`() ` |\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onChanged](/reference/android/arch/paging/PagedList.Callback#onChanged(int, int))`(int position, int count) ` Called when null padding items have been loaded to signal newly available data, or when data that hasn't been used in a while has been dropped, and swapped back to null. |\n| ` abstract void` | ` `[onInserted](/reference/android/arch/paging/PagedList.Callback#onInserted(int, int))`(int position, int count) ` Called when new items have been loaded at the end or beginning of the list. |\n| ` abstract void` | ` `[onRemoved](/reference/android/arch/paging/PagedList.Callback#onRemoved(int, int))`(int position, int count) ` Called when items have been removed at the end or beginning of the list, and have not been replaced by padded nulls. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### PagedList.Callback\n\n```\nPagedList.Callback ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### onChanged\n\n```\nvoid onChanged (int position, \n int count)\n```\n\nCalled when null padding items have been loaded to signal newly available data, or when\ndata that hasn't been used in a while has been dropped, and swapped back to null.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|------------------------------------------------------------------------------------------------------------|\n| `position` | `int`: Position of first newly loaded items, out of total number of items (including padded nulls). \u003cbr /\u003e |\n| `count` | `int`: Number of items loaded. \u003cbr /\u003e |\n\n### onInserted\n\n```\nvoid onInserted (int position, \n int count)\n```\n\nCalled when new items have been loaded at the end or beginning of the list.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------|\n| `position` | `int`: Position of the first newly loaded item (in practice, either `0` or `size - 1`. \u003cbr /\u003e |\n| `count` | `int`: Number of items loaded. \u003cbr /\u003e |\n\n### onRemoved\n\n```\nvoid onRemoved (int position, \n int count)\n```\n\nCalled when items have been removed at the end or beginning of the list, and have not\nbeen replaced by padded nulls.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------|\n| `position` | `int`: Position of the first newly loaded item (in practice, either `0` or `size - 1`. \u003cbr /\u003e |\n| `count` | `int`: Number of items loaded. \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [DataSource.InvalidatedCallback](/reference/android/arch/paging/DataSource.InvalidatedCallback)\n-\n\n Classes\n -------\n\n - [AsyncPagedListDiffer](/reference/android/arch/paging/AsyncPagedListDiffer)\n - [DataSource](/reference/android/arch/paging/DataSource)\n - [DataSource.Factory](/reference/android/arch/paging/DataSource.Factory)\n - [ItemKeyedDataSource](/reference/android/arch/paging/ItemKeyedDataSource)\n - [ItemKeyedDataSource.LoadCallback](/reference/android/arch/paging/ItemKeyedDataSource.LoadCallback)\n - [ItemKeyedDataSource.LoadInitialCallback](/reference/android/arch/paging/ItemKeyedDataSource.LoadInitialCallback)\n - [ItemKeyedDataSource.LoadInitialParams](/reference/android/arch/paging/ItemKeyedDataSource.LoadInitialParams)\n - [ItemKeyedDataSource.LoadParams](/reference/android/arch/paging/ItemKeyedDataSource.LoadParams)\n - [LivePagedListBuilder](/reference/android/arch/paging/LivePagedListBuilder)\n - [PagedList](/reference/android/arch/paging/PagedList)\n - [PagedList.BoundaryCallback](/reference/android/arch/paging/PagedList.BoundaryCallback)\n - [PagedList.Builder](/reference/android/arch/paging/PagedList.Builder)\n - [PagedList.Callback](/reference/android/arch/paging/PagedList.Callback)\n - [PagedList.Config](/reference/android/arch/paging/PagedList.Config)\n - [PagedList.Config.Builder](/reference/android/arch/paging/PagedList.Config.Builder)\n - [PagedListAdapter](/reference/android/arch/paging/PagedListAdapter)\n - [PageKeyedDataSource](/reference/android/arch/paging/PageKeyedDataSource)\n - [PageKeyedDataSource.LoadCallback](/reference/android/arch/paging/PageKeyedDataSource.LoadCallback)\n - [PageKeyedDataSource.LoadInitialCallback](/reference/android/arch/paging/PageKeyedDataSource.LoadInitialCallback)\n - [PageKeyedDataSource.LoadInitialParams](/reference/android/arch/paging/PageKeyedDataSource.LoadInitialParams)\n - [PageKeyedDataSource.LoadParams](/reference/android/arch/paging/PageKeyedDataSource.LoadParams)\n - [PositionalDataSource](/reference/android/arch/paging/PositionalDataSource)\n - [PositionalDataSource.LoadInitialCallback](/reference/android/arch/paging/PositionalDataSource.LoadInitialCallback)\n - [PositionalDataSource.LoadInitialParams](/reference/android/arch/paging/PositionalDataSource.LoadInitialParams)\n - [PositionalDataSource.LoadRangeCallback](/reference/android/arch/paging/PositionalDataSource.LoadRangeCallback)\n - [PositionalDataSource.LoadRangeParams](/reference/android/arch/paging/PositionalDataSource.LoadRangeParams)\n - [RxPagedListBuilder](/reference/android/arch/paging/RxPagedListBuilder)"]]