Fix search around location

This commit is contained in:
Victor Shcherb 2015-03-09 09:32:04 +01:00
parent 26470555fe
commit c26ac71ee2

View file

@ -206,10 +206,10 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
if (position != 0) {
if (position == POSITION_CURRENT_LOCATION) {
net.osmand.Location loc = getLocationProvider().getLastKnownLocation();
searchAroundCurrentLocation = true;
if(loc != null && System.currentTimeMillis() - loc.getTime() < 10000) {
updateLocation(loc);
} else {
searchAroundCurrentLocation = true;
startSearchCurrentLocation();
}
} else {
@ -281,9 +281,10 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
if (location != null) {
updateSearchPoint(new LatLon(location.getLatitude(), location.getLongitude()),
getString(R.string.select_search_position) + " " + getString(R.string.search_position_current_location_found), false);
if (location.getAccuracy() < 20) {
endSearchCurrentLocation();
}
// don't stop in case we want to see updates
// if (location.getAccuracy() < 20) {
// endSearchCurrentLocation();
// }
}
}
public void startSearchCurrentLocation(){