complete change for missing distance update upon origin change in SearchHistoryFragment

This commit is contained in:
sonora 2014-12-30 11:20:25 +01:00
parent 46e72e5bc6
commit ed17ced7ba

View file

@ -89,6 +89,7 @@ public class SearchHistoryFragment extends SherlockListFragment implements Sear
if (location == null) { if (location == null) {
location = ((OsmandApplication) activity.getApplication()).getSettings().getLastKnownMapLocation(); location = ((OsmandApplication) activity.getApplication()).getSettings().getLastKnownMapLocation();
} }
locationUpdate(location);
clearButton.setVisibility(historyAdapter.isEmpty() ? View.GONE : View.VISIBLE); clearButton.setVisibility(historyAdapter.isEmpty() ? View.GONE : View.VISIBLE);
} }
@ -97,8 +98,6 @@ public class SearchHistoryFragment extends SherlockListFragment implements Sear
public void locationUpdate(LatLon l) { public void locationUpdate(LatLon l) {
location = l; location = l;
if(historyAdapter != null) { if(historyAdapter != null) {
//historyAdapter.notifyDataSetChanged();
//This did not update distances when origin was changed, try this:
historyAdapter.updateLocation(l); historyAdapter.updateLocation(l);
} }
} }