Skip to content

Instantly share code, notes, and snippets.

@adriantache
Last active May 7, 2019 16:08
Show Gist options
  • Save adriantache/5dae6ffd379b9352248a63f191cda24d to your computer and use it in GitHub Desktop.
Save adriantache/5dae6ffd379b9352248a63f191cda24d to your computer and use it in GitHub Desktop.
WorkManager.getInstance(context).enqueue(notificationWork);
//alternatively, we can use this form to determine what happens to the existing stack
// WorkManager.getInstance(context).beginUniqueWork(workTag, ExistingWorkPolicy.REPLACE, notificationWork);
//ExistingWorkPolicy.REPLACE - Cancel the existing sequence and replace it with the new one
//ExistingWorkPolicy.KEEP - Keep the existing sequence and ignore your new request
//ExistingWorkPolicy.APPEND - Append your new sequence to the existing one,
//running the new sequence's first task after the existing sequence's last task finishes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment