WorkContinuation

abstract class WorkContinuation
kotlin.Any
   ↳ androidx.work.WorkContinuation

An opaque class that allows you to chain together OneTimeWorkRequest.

Summary

Public constructors

Public methods
WorkContinuation!
then(vararg work: OneTimeWorkRequest!)

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequest.

abstract WorkContinuation!

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequest.

abstract Unit

Enqueues the instance of WorkContinuation on the background thread.

abstract LiveData!

Returns a LiveData list of WorkStatus that provides information about work, their progress, and any resulting output.

abstract SynchronousWorkContinuation!

Gets an object that gives access to synchronous methods.

open static WorkContinuation!
combine(vararg continuations: WorkContinuation!)

Combines multiple WorkContinuations to allow for complex chaining.

open static WorkContinuation!

Combines multiple WorkContinuations to allow for complex chaining.

open static WorkContinuation!
combine(work: OneTimeWorkRequest, vararg continuations: WorkContinuation!)

Combines multiple WorkContinuations to allow for complex chaining using the OneTimeWorkRequest provided.

open static WorkContinuation!

Combines multiple WorkContinuations to allow for complex chaining using the OneTimeWorkRequest provided.

Public constructors

<init>

WorkContinuation()

Public methods

then

fun then(vararg work: OneTimeWorkRequest!): WorkContinuation!

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequest.

Parameters
work OneTimeWorkRequest!: One or more OneTimeWorkRequest to add to the WorkContinuation
Return
WorkContinuation!: A WorkContinuation that allows for further chaining of dependent OneTimeWorkRequest

then

abstract fun then(work: MutableList<OneTimeWorkRequest!>): WorkContinuation!

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequest.

Parameters
work MutableList<OneTimeWorkRequest!>: One or more OneTimeWorkRequest to add to the WorkContinuation
Return
WorkContinuation!: A WorkContinuation that allows for further chaining of dependent OneTimeWorkRequest

enqueue

abstract fun enqueue(): Unit

Enqueues the instance of WorkContinuation on the background thread.

getStatuses

abstract fun getStatuses(): LiveData!

Returns a LiveData list of WorkStatus that provides information about work, their progress, and any resulting output. If state or outputs of any of the jobs in this chain changes, any attached android.arch.lifecycle.Observers will trigger.

Return
LiveData!: A LiveData containing a list of WorkStatuses

synchronous

abstract fun synchronous(): SynchronousWorkContinuation!

Gets an object that gives access to synchronous methods.

Return
SynchronousWorkContinuation!: A SynchronousWorkContinuation object, which gives access to synchronous methods

combine

open static fun combine(vararg continuations: WorkContinuation!): WorkContinuation!

Combines multiple WorkContinuations to allow for complex chaining.

Parameters
continuations WorkContinuation!: Two or more WorkContinuations that are prerequisites for the return value
Return
WorkContinuation!: A WorkContinuation that allows further chaining

combine

open static fun combine(continuations: MutableList<WorkContinuation!>): WorkContinuation!

Combines multiple WorkContinuations to allow for complex chaining.

Parameters
continuations MutableList<WorkContinuation!>: Two or more WorkContinuations that are prerequisites for the return value
Return
WorkContinuation!: A WorkContinuation that allows further chaining

combine

open static fun combine(work: OneTimeWorkRequest, vararg continuations: WorkContinuation!): WorkContinuation!

Combines multiple WorkContinuations to allow for complex chaining using the OneTimeWorkRequest provided.

Parameters
work OneTimeWorkRequest: The OneTimeWorkRequest which depends on the successful completion of the provided WorkContinuations
continuations OneTimeWorkRequest: Two or more WorkContinuations that are prerequisites for the OneTimeWorkRequest provided.
Return
WorkContinuation!: A WorkContinuation that allows further chaining

combine

open static fun combine(work: OneTimeWorkRequest, continuations: MutableList<WorkContinuation!>): WorkContinuation!

Combines multiple WorkContinuations to allow for complex chaining using the OneTimeWorkRequest provided.

Parameters
work OneTimeWorkRequest: The OneTimeWorkRequest which depends on the successful completion of the provided WorkContinuations
continuations OneTimeWorkRequest: Two or more WorkContinuations that are prerequisites for the OneTimeWorkRequest provided.
Return
WorkContinuation!: A WorkContinuation that allows further chaining