5 concepts · 15 practice questions
Paging 3 loads a long list in pages as the user scrolls. A PagingSource loads one page for a key; cachedIn keeps loaded pages in memory across configuration changes; a RemoteMediator fills a Room table from the network so the list pages from the database and works offline.
val articles: Flow<PagingData<Article>> = Pager(PagingConfig(pageSize = 30)) {
articleDao.pagingSource()
}.flow.cachedIn(viewModelScope)
Sign in to read the rest and take the 15-question test.
Sign in to continue