Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

State

public final enum State
extends Enum<State>

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


The current state of a unit of work.

Summary

Enum values

State  BLOCKED

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

State  CANCELLED

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

State  ENQUEUED

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

State  FAILED

The state for work that has completed in a failure state  

State  RUNNING

The state for work that is currently being executed  

State  SUCCEEDED

The state for work that has completed successfully  

Public methods

boolean isFinished()

Returns true if this State is considered finished.

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

Inherited methods

Enum values

BLOCKED

public static final State BLOCKED

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

CANCELLED

public static final State CANCELLED

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

ENQUEUED

public static final State ENQUEUED

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

FAILED

public static final State FAILED

The state for work that has completed in a failure state

RUNNING

public static final State RUNNING

The state for work that is currently being executed

SUCCEEDED

public static final 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 State valueOf (String name)

Parameters
name String

Returns
State

values

public static final State[] values ()

Returns
State[]