Created
May 7, 2018 21:28
-
-
Save parahall/985bcf79f382149fb9ca09a86e3fc854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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