Category "kotlin-coroutines"

How to wait for khttp (kotlin) response in Android

I've been trying to use khttp to send an .jpg file in an android activity but haven't been able to make it work. fun sendImage(view: View) { try {

MutableLiveData: Cannot invoke setValue on a background thread from Coroutine

I'm trying to trigger an update on LiveData from a coroutine: object AddressList: MutableLiveData<List<Address>>() fun getAddressesLiveData(): Live

What is the difference between limitedParallelism vs a fixed thread pool dispatcher?

I am trying to use Kotlin coroutines to perform multiple HTTP calls concurrently, rather than one at a time, but I would like to avoid making all of the calls c

How can I create single-thread coroutine context under Common pool in Kotlin?

Short requirement: have ability to create corotine context, which will executed in the single thread only (e.g. without parallelism). Additional requirement: i

How do I return function value in lifecycle-aware coroutine scope in Android?

fun returnValue(): Int { viewModelScope.launch { return 1 // Something like this } } I want to return some value in a viewModelScope like the