I stumbled upon this message recently, and I was pretty sure that this constructor wasn't deprecated in prior versions to 18.0.0, but I cannot find information anywhere that this one has been deprecated either.
And what should we use instead, is there another way to create a locationRequest
?
LocationRequest.create().apply{ ... }
is now also deprecated.
Please use LocationRequest.Builder()
instead. I.E. like this:
(locationInterval
, locationFastestInterval
and locationMaxWaitTime
corresponds to the values used before when using create()
)
locationRequest = LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, locationInterval)
.setWaitForAccurateLocation(false)
.setMinUpdateIntervalMillis(locationFastestInterval)
.setMaxUpdateDelayMillis(locationMaxWaitTime)
.build()
Please read more here: https://developer.android.com/reference/android/location/LocationRequest.Builder