'Is 'constructor LocationRequest()' deprecated in google maps v2?
Solution 1:[1]
Yes, the LocationRequest constructor is deprecated. You can use its static method LocationRequest.create()
to create a location request.
Kotlin:
locationRequest = LocationRequest.create().apply {
interval = 100
fastestInterval = 50
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
maxWaitTime = 100
}
Java:
locationRequest = LocationRequest.create()
.setInterval(100)
.setFastestInterval(3000)
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
.setMaxWaitTime(100);
Solution 2:[2]
For anyone who faces this error in geolocator 8.0.1
of Flutter.
Try to edit FusedLocationClient.java:199
for now. Then wait for author to update the pub package
From
LocationRequest locationRequest = new LocationRequest();
To
LocationRequest locationRequest = LocationRequest.create();
Solution 3:[3]
LocationRequest locationRequest = LocationRequest.create() //if you want access of variable
.setInterval(100)
.setFastestInterval(3000)
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
.setNumUpdates(1)
.setMaxWaitTime(100);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Roc Boronat |
Solution 2 | ANDYNVT |
Solution 3 | Rathod Ruturaj sinh |