I use Handler(Looper.getMainLooper()).post(runnable) which places the query on the end of the thread queue instead of running it immediately. Is it ok to use this with kotlin, or is it better to use coroutines now (like lifecycleScope.launchWhenResumed {}). Or in these cases, you can leave it like that?
Please, help me
Coroutines need to be mapped by a dispatcher to a thread. I think that
Dispatchers.Mainuses handlers to do it (details), so there shouldn't be a major change in performance.Coroutines are lifecycle aware and you will have to use them anyway if you use libraries with suspend functions (I doubt there is a workaround?), but you can still use handlers.