PagingSource.LoadParams.Refresh
public final class PagingSource.LoadParams.Refresh<Key extends Object> extends PagingSource.LoadParams
| java.lang.Object | ||
| ↳ | androidx.paging.PagingSource.LoadParams | |
| ↳ | androidx.paging.PagingSource.LoadParams.Refresh |
Params for an initial load request on a PagingSource from PagingSource.load or a refresh triggered by invalidate.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
Key |
getKey()Key for the page to be loaded. |
Inherited methods |
||||
|---|---|---|---|---|
|
Public constructors
Public methods
getKey
public Key getKey()
Key for the page to be loaded.
key can be null only if this LoadParams is Refresh, and either no initialKey is provided to the Pager or PagingSource.getRefreshKey from the previous PagingSource returns null.
The value of key is dependent on the type of LoadParams:
-
On initial load, the nullable
initialKeypassed to thePager. -
On subsequent loads due to invalidation or refresh, the result of
PagingSource.getRefreshKey. -
Prepend-LoadResult.Page.prevKeyof the loaded page at the front of the list. -
Append-LoadResult.Page.nextKeyof the loaded page at the end of the list.