# WorkManagerInitializer

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/WorkManagerInitializer.java+class:androidx.work.WorkManagerInitializer) Added in [2.6.0](https://developer.android.com/jetpack/androidx/releases/work#2.6.0)

*** ** * ** ***


```
public final class WorkManagerInitializer implements Initializer<WorkManager>
```

<br />

*** ** * ** ***

Initializes `https://developer.android.com/reference/androidx/work/WorkManager` using `androidx.startup`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/work/WorkManagerInitializer#WorkManagerInitializer()()` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/WorkManager` | `https://developer.android.com/reference/androidx/work/WorkManagerInitializer#create(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Initializes a library component within the application `https://developer.android.com/reference/android/content/Context.html`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/androidx/startup/Initializer<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>>` | `https://developer.android.com/reference/androidx/work/WorkManagerInitializer#dependencies()()` Gets a list of this initializer's dependencies. |

## Public constructors

### WorkManagerInitializer

Added in 2.6.0

```
public WorkManagerInitializer()
```

## Public methods

### create

Added in [2.6.0](https://developer.android.com/jetpack/androidx/releases/work#2.6.0)

```
public @NonNull WorkManager create(@NonNull Context context)
```

Initializes a library component within the application `https://developer.android.com/reference/android/content/Context.html`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | The application context. |

### dependencies

Added in [2.6.0](https://developer.android.com/jetpack/androidx/releases/work#2.6.0)

```
public @NonNull List<Class<Initializer<@NonNull ?>>> dependencies()
```

Gets a list of this initializer's dependencies. Dependencies are initialized before the dependent initializer. For example, if initializer A defines initializer B as a dependency, B is initialized before A.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/androidx/startup/Initializer<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>>` | A list of initializer dependencies. |