Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[android] - fix LOST location updates #8445

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public Location getLastLocation() {
public void requestLocationUpdates() {
// Common params
LocationRequest request = LocationRequest.create()
.setInterval(1000)
.setFastestInterval(1000)
.setSmallestDisplacement(3.0f);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,10 @@ private static class GpsLocationListener implements LocationEngineListener {
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();
}
}

Expand Down