Conclusion

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

That’s it! You’ve just implemented your first coroutine. You’ve learned:

  • How to start a coroutine in an Android application.
  • The difference between the runBlocking and the launch coroutine builders and between blocking and suspending code execution.
  • How to cancel coroutines. Remember that a coroutine cancellation consists of throwing an exception. You must not catch the exception without re-throwing it later, because the coroutine in question could keep running indefinitely.

In the next lesson, you’ll learn about coroutine scopes and dispatchers.

See forum comments
Download course materials from Github
Previous: Demo Next: Use Coroutines