Last active
March 6, 2019 12:13
-
-
Save robertlevonyan/5e821bc3ae9e4224d2d1bbea486f6dcb 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
class LocationWorker(context: Context, workerParams: WorkerParameters) | |
: Worker(context, workerParams) { | |
... | |
override fun doWork(): Result { | |
val latitude = inputData.getDouble(KEY_LATITUDE, 40.1903484) | |
val longitude = inputData.getDouble(KEY_LONGITUDE, 44.5148367) | |
val sendDataService = SendDataService.getInstance() | |
sendDataService.sendLocation(latitude, longitude) | |
.addSuccessCallback { | |
// do smth | |
} | |
.addFailureCallback { | |
// do smth | |
} | |
return Result.success() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment