WorkInfo.State

public static final enum WorkInfo.State
extends Enum<WorkInfo.State>

java.lang.Object
   ↳ java.lang.Enum<androidx.work.WorkInfo.State>
     ↳ androidx.work.WorkInfo.State


The current state of a unit of work.

Summary

Enum values

WorkInfo.State  BLOCKED

The state for work that is currently blocked because its prerequisites haven't finished successfully  

WorkInfo.State  CANCELLED

The state for work that has been cancelled and will not execute  

WorkInfo.State  ENQUEUED

The state for work that is enqueued (hasn't completed and isn't running)  

WorkInfo.State  FAILED

The state for work that has completed in a failure state  

WorkInfo.State  RUNNING

The state for work that is currently being executed  

WorkInfo.State  SUCCEEDED

The state for work that has completed successfully  

Public methods

boolean isFinished()

Returns true if this State is considered finished.

static WorkInfo.State valueOf(String name)
static final State[] values()

Inherited methods

Enum values

BLOCKED

public static final WorkInfo.State BLOCKED

The state for work that is currently blocked because its prerequisites haven't finished successfully

CANCELLED

public static final WorkInfo.State CANCELLED

The state for work that has been cancelled and will not execute

ENQUEUED

public static final WorkInfo.State ENQUEUED

The state for work that is enqueued (hasn't completed and isn't running)

FAILED

public static final WorkInfo.State FAILED

The state for work that has completed in a failure state

RUNNING

public static final WorkInfo.State RUNNING

The state for work that is currently being executed

SUCCEEDED

public static final WorkInfo.State SUCCEEDED

The state for work that has completed successfully

Public methods

isFinished

public boolean isFinished ()

Returns true if this State is considered finished.

Returns
boolean true for SUCCEEDED, FAILED, and CANCELLED states

valueOf

public static WorkInfo.State valueOf (String name)

Parameters
name String

Returns
WorkInfo.State

values

public static final State[] values ()

Returns
State[]