Created
March 18, 2021 11:50
-
-
Save Alqueraf/1aff9f35df8ec91324bf22407dff55e4 to your computer and use it in GitHub Desktop.
Coroutine Context Switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope.launch(Dispatchers.IO) { | |
val result = apiService.getListData() | |
withContext(Dispatchers.Main) { | |
adapter.submitList(result) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment