[android-components](../../index.md) / [mozilla.components.feature.downloads](../index.md) / [CoroutineService](index.md) / [onStartCommand](./on-start-command.md)

# onStartCommand

`fun onStartCommand(intent: <ERROR CLASS>?, flags: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, startId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/feature/downloads/src/main/java/mozilla/components/feature/downloads/CoroutineService.kt#L45)

Starts a job using [onStartCommand](#) then stops the service once all jobs are complete.

