After calling a suspend method inside a CoroutineScope launch block, the code after the suspend call is not executing.
lifecycleScope.launch {
adapter.source!!.submit(page as PagingData<Receipt>)//suspend call
//not executing
if (setInitialItem) {
Log.d("INITIALSET", "set initial")
pager.currentItem = intent.getIntExtra(POSITION, 0)
}
}
The submit method is defined in androidx.paging.AsyncPagingDataDiffer
//snippet
suspend fun submitData(pagingData: PagingData<T>) {
submitDataId.incrementAndGet()
differBase.collectFrom(pagingData)
}