WorkInfo.State


enum WorkInfo.State : Enum


The current lifecycle state of a WorkRequest.

Summary

Enum Values

BLOCKED

Used to indicate that the WorkRequest is currently blocked because its prerequisites haven't finished successfully.

CANCELLED

Used to indicate that the WorkRequest has been cancelled and will not execute.

ENQUEUED

Used to indicate that the WorkRequest is enqueued and eligible to run when its Constraints are met and resources are available.

FAILED

Used to indicate that the WorkRequest has completed in a failure state.

RUNNING

Used to indicate that the WorkRequest is currently being executed.

SUCCEEDED

Used to indicate that the WorkRequest has completed in a successful state.

Public functions

WorkInfo.State
valueOf(value: String)

Returns the enum constant of this type with the specified name.

Array<WorkInfo.State>

Returns an array containing the constants of this enum type, in the order they're declared.

Public properties

EnumEntries<WorkInfo.State>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Boolean

Returns true if this State is considered finished: .SUCCEEDED, .FAILED, and * .CANCELLED

Enum Values

BLOCKED

val WorkInfo.State.BLOCKEDWorkInfo.State

Used to indicate that the WorkRequest is currently blocked because its prerequisites haven't finished successfully.

CANCELLED

val WorkInfo.State.CANCELLEDWorkInfo.State

Used to indicate that the WorkRequest has been cancelled and will not execute. All dependent work will also be marked as #CANCELLED and will not run.

ENQUEUED

val WorkInfo.State.ENQUEUEDWorkInfo.State

Used to indicate that the WorkRequest is enqueued and eligible to run when its Constraints are met and resources are available.

FAILED

val WorkInfo.State.FAILEDWorkInfo.State

Used to indicate that the WorkRequest has completed in a failure state. All dependent work will also be marked as #FAILED and will never run.

RUNNING

val WorkInfo.State.RUNNINGWorkInfo.State

Used to indicate that the WorkRequest is currently being executed.

SUCCEEDED

val WorkInfo.State.SUCCEEDEDWorkInfo.State

Used to indicate that the WorkRequest has completed in a successful state. Note that PeriodicWorkRequests will never enter this state (they will simply go back to .ENQUEUED and be eligible to run again).

Public functions

valueOf

Added in 1.0.0
fun valueOf(value: String): WorkInfo.State

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

Added in 1.0.0
fun values(): Array<WorkInfo.State>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

Public properties

entries

val entriesEnumEntries<WorkInfo.State>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.

isFinished

Added in 1.0.0
val isFinishedBoolean

Returns true if this State is considered finished: .SUCCEEDED, .FAILED, and * .CANCELLED