Line of code in a coroutine scope after a suspend method call not executing

738 views Asked by At

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)
    }
0

There are 0 answers