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 lifecycle state of a WorkRequest.
Summary
Enum values | |
|---|---|
WorkInfo.State |
BLOCKED
Used to indicate that the |
WorkInfo.State |
CANCELLED
Used to indicate that the |
WorkInfo.State |
ENQUEUED
Used to indicate that the |
WorkInfo.State |
FAILED
Used to indicate that the |
WorkInfo.State |
RUNNING
Used to indicate that the |
WorkInfo.State |
SUCCEEDED
Used to indicate that the |
Public methods | |
|---|---|
boolean
|
isFinished()
Returns |
static
WorkInfo.State
|
valueOf(String name)
|
static
final
State[]
|
values()
|
Inherited methods | |
|---|---|
Enum values
BLOCKED
public static final WorkInfo.State BLOCKED
Used to indicate that the WorkRequest is currently blocked because its
prerequisites haven't finished successfully.
CANCELLED
public static final WorkInfo.State 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.
ENQUEUED
public static final WorkInfo.State ENQUEUED
Used to indicate that the WorkRequest is enqueued and eligible to run when its
Constraints are met and resources are available.
FAILED
public static final WorkInfo.State 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.
RUNNING
public static final WorkInfo.State RUNNING
Used to indicate that the WorkRequest is currently being executed.
SUCCEEDED
public static final WorkInfo.State 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 ENQUEUED and be eligible to run again).
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 |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2019-12-27 UTC.