Skip to content

Instantly share code, notes, and snippets.



Last active Nov 2, 2019
What would you like to do?
Simple example on how to use Coroutines on Android.
// Activity::onCreate
val job = Job()
val coroutineScope = CoroutineScope(Dispatchers.IO + job)
coroutineScope.launch {
val json = URL("").readText()
withContext(Dispatchers.Main) {
findViewById<TextView>( = json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment