Created
May 10, 2018 06:01
-
-
Save parahall/1a42f7663aa679bacb97f268a20c13be 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(); | |
Data inputData = new Data.Builder() | |
.putDouble(LocationUploadWorker.LOCATION_LAT, location.getLatitude()) | |
.putDouble(LocationUploadWorker.LOCATION_LONG, location.getLongitude()) | |
.putLong(LocationUploadWorker.LOCATION_TIME, location.getTime()) | |
.build(); | |
OneTimeWorkRequest uploadWork = new OneTimeWorkRequest.Builder(LocationUploadWorker.class) | |
.setConstraints(constraints).setInputData(inputData).build(); | |
WorkManager.getInstance().enqueue(uploadWork); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment