I have implementation of PositionalDataSource that defines loadInitial
and loadRange
. Paging works fine however under some boundary condition (likely related with loading next page in progress while exiting the screen) app crashes with androidx.paging.ContiguousPagedList$1.onPageError (ContiguousPagedList.java:153)
. However a per https://developer.android.com/reference/android/arch/paging/PositionalDataSource my source is not contiguous?
Crash occurs under ContiguousPagedList's onPageError, line with "todo":
public void onPageError(@PageResult.ResultType int resultType,
@NonNull Throwable error, boolean retryable) {
LoadState errorState = retryable ? LoadState.RETRYABLE_ERROR : LoadState.ERROR;
if (resultType == PageResult.PREPEND) {
mLoadStateManager.setState(LoadType.START, errorState, error);
} else if (resultType == PageResult.APPEND) {
mLoadStateManager.setState(LoadType.END, errorState, error);
} else {
// TODO: pass init signal through to *previous* list
throw new IllegalStateException("TODO");
}
}
My configuration is not using placeholders, and I'm not passing total count into onResult
of LoadInitialCallback
. Version of paging library is 2.1.1