From 359b04257416987ab9650ba09018361dc1df0357 Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 30 Dec 2014 10:51:54 +0100 Subject: [PATCH] slighly refactor SearchHistoryFragment to debug missing distance update when origin is chenged --- .../plus/activities/search/SearchHistoryFragment.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java index d48c4460b4..9573743f56 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java @@ -97,7 +97,9 @@ public class SearchHistoryFragment extends SherlockListFragment implements Sear public void locationUpdate(LatLon l) { location = l; if(historyAdapter != null) { - historyAdapter.notifyDataSetChanged(); + //historyAdapter.notifyDataSetChanged(); + //This did not update distances when origin was changed, try this: + historyAdapter.updateLocation(l); } } @@ -126,6 +128,11 @@ public class SearchHistoryFragment extends SherlockListFragment implements Sear class HistoryAdapter extends ArrayAdapter { + public void updateLocation(LatLon l) { + location = l; + notifyDataSetChanged(); + } + public HistoryAdapter(List list) { super(getActivity(), R.layout.search_history_list_item, list); }