I have the following one-time worker.
// Create a Constraints that defines when the task should run
Constraints constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.UNMETERED)
.setRequiresBatteryNotLow(true)
// Many other constraints are available, see the
// Constraints.Builder reference
.build();
OneTimeWorkRequest oneTimeWorkRequest =
new OneTimeWorkRequest.Builder(SyncWorker.class)
.setConstraints(constraints)
.addTag(SyncWorker.TAG)
.build();
According to https://developer.android.com/topic/libraries/architecture/workmanager
// (Returning RETRY tells WorkManager to try this task again
// later; FAILURE says not to try again.)
I was wondering, if SyncWorker
keep returning RETRY
, what is the retry strategy of WorkManager
? For instance, what is the maximum retry count for WorkManager
? The documentation isn't clear on this.