How can ı restore paging adapter item state when ı move to another fragment? I tried article below but it didnt work. https://medium.com/@florina.muntenescu
private fun loadData() {
viewModel.apply {
lifecycleScope.launch{
viewModel.getMorePopularMovies().collectLatest { pagingData ->
dataAdapter.submitData(viewLifecycleOwner.lifecycle, pagingData)
}
}
}
}
fun getMorePopularMovies() = Pager(
PagingConfig(pageSize = 3)
) {
VerticalMoviePagingSource(api, "Popular")
}.flow