Architecture-components-samples: Paging 3 doesn't load the data from database

Created on 15 Jun 2020  路  6Comments  路  Source: android/architecture-components-samples

Paging 3 database + network doesn't load the offline data from database when opening the app without internet connection in the sample. The codelab has the same issue too.

paging

All 6 comments

Seems to be similar to the second issue here: http://issuetracker.google.com//issues/158892717

Make sure your loadStateFlow / loadStateListener on PagingDataAdapter is not checking for mediator refresh, but only for source / local refresh.

https://developer.android.com/reference/kotlin/androidx/paging/CombinedLoadStates

Note the implementation for CombinedLoadStates.refresh is to default to mediator if it exists.

Would be great if u could provide a sample code snippet for that.
I'm trying to understand how it works too.

@dlam any updates ?

I ended up giving this a shot and found a bug which is blocking this behavior.

The fix if you're interested in tracking progress is wip here: https://android-review.googlesource.com/c/platform/frameworks/support/+/1341068

Thanks @dlam . will check it out.

This is fixed now and will go out with the alpha02 release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

easyandroid-cc picture easyandroid-cc  路  13Comments

nexuscomputing picture nexuscomputing  路  57Comments

PingForward picture PingForward  路  16Comments

ShahakM picture ShahakM  路  13Comments

wafer-li picture wafer-li  路  14Comments