lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey

OneTimeWorkRequest

public final class OneTimeWorkRequest
extends WorkRequest

java.lang.Object
   ↳ androidx.work.WorkRequest
     ↳ androidx.work.OneTimeWorkRequest


A class that represents a request for non-repeating work.

Summary

Nested classes

class OneTimeWorkRequest.Builder

Builder for OneTimeWorkRequest class. 

Inherited constants

Public methods

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

Creates a list of OneTimeWorkRequest with defaults from an array of Worker class names.

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

Creates an array of OneTimeWorkRequest with defaults from an array of Worker class names.

Inherited methods

Public methods

from

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

Creates a list of OneTimeWorkRequest with defaults from an array of Worker class names.

Parameters
workerClasses List: A list of Worker class names

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

from

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

Creates an array of OneTimeWorkRequest with defaults from an array of Worker class names.

Parameters
workerClasses Class: An array of Worker class names

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