From fdaa903dbd78071fc3c90b7d92e0c5b1091faede Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 29 Nov 2015 15:47:50 +0100 Subject: [PATCH] Fix results --- .../src/net/osmand/plus/CurrentPositionHelper.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java b/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java index 3a6624c2ea..9c86875e38 100644 --- a/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java +++ b/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java @@ -124,19 +124,14 @@ public class CurrentPositionHelper { } } Collections.sort(complete, GeocodingUtilities.DISTANCE_COMPARATOR); - for(final GeocodingResult r : complete) { - if(r.building != null && - r.getDistance() > minBuildingDistance * GeocodingUtilities.THRESHOLD_MULTIPLIER_SKIP_BUILDINGS_AFTER) { - continue; - } + if(complete.size() > 0) { + final GeocodingResult rts = complete.get(0); app.runInUIThread(new Runnable() { public void run() { - result.publish(r); + result.publish(rts); } - }); - break; + }); } - } private static double getOrthogonalDistance(RouteDataObject r, Location loc){