Created
November 20, 2018 19:43
-
-
Save jdsingh/de52b82ad433ca5a159933f891e51dfd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private fun getLocation(lastLocation: Task<Location>) { | |
lastLocation.addOnCompleteListener { task -> | |
if (task.isSuccessful) { | |
val data = workDataOf( | |
"latitude" to location.latitude, | |
"longitude" to location.longitude | |
) | |
future.set(Payload(Result.SUCCESS, data)) | |
} else { | |
future.setException(task.exception) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment