DelegatingWorkerFactory
open class DelegatingWorkerFactory : WorkerFactory
kotlin.Any | ||
↳ | androidx.work.WorkerFactory | |
↳ | androidx.work.DelegatingWorkerFactory |
A WorkerFactory
which delegates to other factories. Factories can register themselves as delegates, and they will be invoked in order until a delegated factory returns a non-null ListenableWorker
instance.
Summary
Public constructors | |
---|---|
<init>() Creates a new instance of the |
Public methods | |
---|---|
Unit |
addFactory(@NonNull workerFactory: WorkerFactory) Adds a |
ListenableWorker? |
createWorker(@NonNull context: Context, @NonNull workerClass: String, @NonNull parameters: WorkerParameters) |
Public constructors
Public methods
addFactory
fun addFactory(@NonNull workerFactory: WorkerFactory): Unit
Adds a WorkerFactory
to the list of delegates.
Parameters | |
---|---|
workerFactory |
WorkerFactory: The WorkerFactory instance. |
createWorker
@Nullable fun createWorker(
@NonNull context: Context,
@NonNull workerClass: String,
@NonNull parameters: WorkerParameters
): ListenableWorker?