Created
May 7, 2018 21:27
-
-
Save parahall/f0ae636308b4ae84a43e0335695ae865 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
//Create constraints | |
Constraints constraints = new Constraints.Builder().setRequiredNetworkType | |
(NetworkType.CONNECTED).build(); | |
//create work | |
Work uploadWork = new Work.Builder(LocationUploadWorker.class).withConstraints | |
(constraints).build(); | |
//schedule work | |
WorkManager.getInstance(this).enqueue(uploadWork); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment