public enum

WorkInfo.State

extends java.lang.Enum<WorkInfo.State>

 java.lang.Object

↳java.lang.Enum<WorkInfo.State>

↳androidx.work.WorkInfo.State

Overview

The current lifecycle state of a WorkRequest.

Summary

Enum Constants
BLOCKEDUsed to indicate that the WorkRequest is currently blocked because its prerequisites haven't finished successfully.
CANCELLEDUsed to indicate that the WorkRequest has been cancelled and will not execute.
ENQUEUEDUsed to indicate that the WorkRequest is enqueued and eligible to run when its Constraints are met and resources are available.
FAILEDUsed to indicate that the WorkRequest has completed in a failure state.
RUNNINGUsed to indicate that the WorkRequest is currently being executed.
SUCCEEDEDUsed to indicate that the WorkRequest has completed in a successful state.
Methods
public booleanisFinished()

Returns true if this State is considered finished.

public static WorkInfo.StatevalueOf(java.lang.String name)

public static WorkInfo.Statevalues()

from java.lang.Enum<E>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
from java.lang.ObjectgetClass, notify, notifyAll, wait, wait, wait

Enum Constants

ENQUEUED

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

RUNNING

Used to indicate that the WorkRequest is currently being executed.

SUCCEEDED

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 WorkInfo.State.ENQUEUED and be eligible to run again).

FAILED

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.

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. All dependent work will also be marked as #CANCELLED and will not run.

Methods

public static WorkInfo.State values()

public static WorkInfo.State valueOf(java.lang.String name)

public boolean isFinished()

Returns true if this State is considered finished.

Returns:

true for WorkInfo.State.SUCCEEDED, WorkInfo.State.FAILED, and * WorkInfo.State.CANCELLED states