Syntax

Kotlin Launch a Coroutine Syntax

In Kotlin, launch a coroutine: runs async work in a coroutine scope — scope.launch { val data = load() }

Quick Answer

Syntax
scope.launch { val data = load() }
KotlinSyntax

Launch a Coroutine

Code example
scope.launch { val data = load() }

Runs async work in a coroutine scope.

Learn More

How to launch a coroutine in Kotlin

  1. Open your Kotlin file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Kotlin Launch a Coroutine Syntax

Use scope.launch { val data = load() }.

Related Syntax References

Frequently asked questions

What is the Kotlin syntax for launch a coroutine?

Use this pattern: scope.launch { val data = load() }

Can I copy this Kotlin code example?

Yes. Use Copy code and adapt the example to your program.

Is this Kotlin syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify