[android] - fix LOST location updates (#8445)
This commit is contained in:
@@ -102,6 +102,7 @@ public class LocationSource extends LocationEngine implements
|
||||
public void requestLocationUpdates() {
|
||||
// Common params
|
||||
LocationRequest request = LocationRequest.create()
|
||||
.setInterval(1000)
|
||||
.setFastestInterval(1000)
|
||||
.setSmallestDisplacement(3.0f);
|
||||
|
||||
|
||||
@@ -573,8 +573,10 @@ public class MyLocationView extends View {
|
||||
public void onConnected() {
|
||||
MyLocationView locationView = userLocationView.get();
|
||||
if (locationView != null) {
|
||||
Location location = LocationSource.getLocationEngine(locationView.getContext()).getLastLocation();
|
||||
LocationEngine locationSource = LocationSource.getLocationEngine(locationView.getContext());
|
||||
Location location = locationSource.getLastLocation();
|
||||
locationView.setLocation(location);
|
||||
locationSource.requestLocationUpdates();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user