Register now for Android Dev Summit 2019!

OneTimeWorkRequest

class OneTimeWorkRequest : WorkRequest
kotlin.Any
   ↳ androidx.work.WorkRequest
   ↳ androidx.work.OneTimeWorkRequest

A WorkRequest for non-repeating work.

OneTimeWorkRequests can be put in simple or complex graphs of work by using methods like WorkManager#beginWith(OneTimeWorkRequest) or WorkManager#beginWith(List).

Summary

Nested classes

Builder for OneTimeWorkRequests.

Inherited constants

Public methods

static OneTimeWorkRequest
from(@NonNull workerClass: Class<out ListenableWorker!>)

Creates a OneTimeWorkRequest with defaults from a ListenableWorker class name.

static MutableList<OneTimeWorkRequest!>
from(@NonNull workerClasses: MutableList<Class<out ListenableWorker!>!>)

Creates a list of OneTimeWorkRequests with defaults from an array of ListenableWorker class names.

Inherited functions

Public methods

from

@NonNull static fun from(@NonNull workerClass: Class<out ListenableWorker!>): OneTimeWorkRequest

Creates a OneTimeWorkRequest with defaults from a ListenableWorker class name.

Parameters
workerClass Class<out ListenableWorker!>: An ListenableWorker class name
Return
OneTimeWorkRequest: A OneTimeWorkRequest constructed by using defaults in the Builder

from

@NonNull static fun from(@NonNull workerClasses: MutableList<Class<out ListenableWorker!>!>): MutableList<OneTimeWorkRequest!>

Creates a list of OneTimeWorkRequests with defaults from an array of ListenableWorker class names.

Parameters
workerClasses MutableList<Class<out ListenableWorker!>!>: A list of ListenableWorker class names
Return
MutableList<OneTimeWorkRequest!>: A list of OneTimeWorkRequest constructed by using defaults in the