Skip to content

Instantly share code, notes, and snippets.

@parahall
Created May 10, 2018 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parahall/59d6cf43bb26e79c3ef25b346a323e0c to your computer and use it in GitHub Desktop.
Save parahall/59d6cf43bb26e79c3ef25b346a323e0c to your computer and use it in GitHub Desktop.
Constraints constraints = new Constraints.Builder().setRequiredNetworkType
(NetworkType.CONNECTED).build();
PeriodicWorkRequest locationWork = new PeriodicWorkRequest.Builder(LocationWork
.class, 15, TimeUnit.MINUTES).addTag(LocationWork.TAG)
.setConstraints(constraints).build();
WorkManager.getInstance().enqueue(locationWork);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment