lightbulb_outline Please take our October 2018 developer survey. Start survey

ExistingWorkPolicy

public final enum ExistingWorkPolicy
extends Enum<ExistingWorkPolicy>

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


An enum that determines what to do with existing OneTimeWorkRequests with the same unique name in case of a collision.

Summary

Enum values

ExistingWorkPolicy  APPEND

If there is existing pending work with the same unique name, append the newly-specified work as a child of all the leaves of that work sequence. 

ExistingWorkPolicy  KEEP

If there is existing pending work with the same unique name, do nothing. 

ExistingWorkPolicy  REPLACE

If there is existing pending work with the same unique name, cancel and delete it. 

Public methods

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

Inherited methods

Enum values

APPEND

public static final ExistingWorkPolicy APPEND

If there is existing pending work with the same unique name, append the newly-specified work as a child of all the leaves of that work sequence. Otherwise, insert the newly-specified work as the start of a new sequence.

KEEP

public static final ExistingWorkPolicy KEEP

If there is existing pending work with the same unique name, do nothing. Otherwise, insert the newly-specified work.

REPLACE

public static final ExistingWorkPolicy REPLACE

If there is existing pending work with the same unique name, cancel and delete it. Then, insert the newly-specified work.

Public methods

valueOf

public static ExistingWorkPolicy valueOf (String name)

Parameters
name String

Returns
ExistingWorkPolicy

values

public static final ExistingWorkPolicy[] values ()

Returns
ExistingWorkPolicy[]