Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Constraints constraints = new Constraints.Builder().setRequiredNetworkType
(NetworkType.CONNECTED).build();
PeriodicWork locationWork = new PeriodicWork.Builder(LocationWork.class,
FIVETEEN_MIN, TimeUnit.MILLISECONDS).addTag(LocationWork.TAG)
.withConstraints(constraints).build();
WorkManager.getInstance(this).enqueue(locationWork);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment