WorkManagerInitializer


public final class WorkManagerInitializer implements Initializer


Initializes androidx.work.WorkManager using androidx.startup.

Summary

Public constructors

Public methods

@NonNull WorkManager

Initializes a library component within the application Context.

@NonNull List<Class<Initializer<Object>>>

Gets a list of this initializer's dependencies.

Public constructors

WorkManagerInitializer

Added in 2.7.0
public WorkManagerInitializer()

Public methods

create

Added in 2.7.0
public @NonNull WorkManager create(@NonNull Context context)

Initializes a library component within the application Context.

Parameters
@NonNull Context context

The application context.

dependencies

Added in 2.7.0
public @NonNull List<Class<Initializer<Object>>> 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
@NonNull List<Class<Initializer<Object>>>

A list of initializer dependencies.