OneTimeWorkRequest

public final class OneTimeWorkRequest
extends WorkRequest

java.lang.Object
   ↳ 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

class OneTimeWorkRequest.Builder

Builder for OneTimeWorkRequests. 

Inherited constants

Public methods

static List<OneTimeWorkRequest> from(List<Class<? extends ListenableWorker>> workerClasses)

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

static OneTimeWorkRequest from(Class<? extends ListenableWorker> workerClass)

Creates a OneTimeWorkRequest with defaults from a ListenableWorker class name.

Inherited methods

Public methods

from

public static List<OneTimeWorkRequest> from (List<Class<? extends ListenableWorker>> workerClasses)

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

Parameters
workerClasses List: A list of ListenableWorker class names

Returns
List<OneTimeWorkRequest> A list of OneTimeWorkRequest constructed by using defaults in the OneTimeWorkRequest.Builder

from

public static OneTimeWorkRequest from (Class<? extends ListenableWorker> workerClass)

Creates a OneTimeWorkRequest with defaults from a ListenableWorker class name.

Parameters
workerClass Class: An ListenableWorker class name

Returns
OneTimeWorkRequest A OneTimeWorkRequest constructed by using defaults in the OneTimeWorkRequest.Builder