https://kotlinlang.org logo
#coroutines
Title
# coroutines
p

pteale

05/18/2019, 4:09 PM
private fun fibonacci() = GlobalScope.launch(Dispatchers.IO) { val result = fib(25) withContext(Dispatchers.Main) { textViewCalculating.text = result.toString() } }
🧵 2
l

louiscad

05/18/2019, 8:05 PM
Do not use
GlobalScope
, it's dangerous (leaks…). Use AndroidX lifecycle runtime KTX and use
lifecycleScope
instead.
6 Views