Guest User

Untitled

a guest
Feb 22nd, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. launch(UI) {
  2. val bitmapDrawable = loadLargeBitmapDrawable()
  3. imageView.setImageDrawable(bitmapDrawable)
  4. }
  5.  
  6. launch { // <- I removed the "UI"
  7. val bitmapDrawable = loadLargeBitmapDrawable()
  8.  
  9. launch(UI) { //Launch the UI coroutine inside the other
  10. imageView.setImageDrawable(bitmapDrawable)
  11. }
  12.  
  13. }
  14.  
  15. launch(UI) {
  16. val bitmapDrawable = withContext(CommonPool) {
  17. loadLargeBitmapDrawable()
  18. }
  19. imageView.setImageDrawable(bitmapDrawable)
  20. }
Add Comment
Please, Sign In to add comment