<Attempt to collect twice from pageEventFlow, whic...
# stackoverflow
r
Attempt to collect twice from pageEventFlow, which is an illegal operation. Did you forget to call Flow&lt;PagingData&lt;*&gt;&gt;.cachedIn(coroutineScope)? when I click on my back button in my project, I get an error like this, how can I solve it? **Attempt to collect twice from pageEventFlow, which is an illegal operation. Did you forget to call Flow.cachedIn(coroutineScope)? at app.ui.home.HomeFragment.onViewCreated$lambda-1(HomeFragment.kt:78) ** MyCode : override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) viewModel.lastDocument.observe(viewLifecycleOwner) {...