Android-EasyLocation
Android-EasyLocation copied to clipboard
requestSingleLocationFix returns nothing if location is null
private fun requestOneTimeLocation() {
val locationRequest = LocationRequest()
.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)
.setInterval(5000)
.setFastestInterval(5000)
val easyLocationRequest = EasyLocationRequestBuilder()
.setLocationRequest(locationRequest)
.setFallBackToLastLocationTime(3000)
.build()
requestSingleLocationFix(easyLocationRequest)
}
I use requestSingleLocationFix, the problem if the location in onLocationChanged of LocationBgService is null then there is no way to capture it and handle it. At least a callback would me much helpful.
I can see the is a noLocationReceived method in EasyLocationListener but for some reason the developer is not active and it is not updated in maven. For now you can manually download and import to your project and it will work as expected.