Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
[ANMA-6194] set location to the last position known when with on GPS …
Browse files Browse the repository at this point in the history
…location
  • Loading branch information
Tran Thuong Tien committed Jun 19, 2017
1 parent eef6f5b commit 84b2c54
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,13 @@ private void toggleGps(boolean enableGps, boolean isCustomLocationSource) {
}
}

// Set an initial location if one available
Location lastLocation = locationSource.getLastLocation();

if (lastLocation != null) {
setLocation(lastLocation);
}

if (userLocationListener == null) {
userLocationListener = new GpsLocationListener(this, locationSource);
}
Expand Down

0 comments on commit 84b2c54

Please sign in to comment.