slighly refactor SearchHistoryFragment to debug missing distance update when origin is chenged
This commit is contained in:
parent
91ba848d07
commit
359b042574
1 changed files with 8 additions and 1 deletions
|
@ -97,7 +97,9 @@ 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();
|
//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<HistoryEntry> {
|
class HistoryAdapter extends ArrayAdapter<HistoryEntry> {
|
||||||
|
|
||||||
|
public void updateLocation(LatLon l) {
|
||||||
|
location = l;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
public HistoryAdapter(List<HistoryEntry> list) {
|
public HistoryAdapter(List<HistoryEntry> list) {
|
||||||
super(getActivity(), R.layout.search_history_list_item, list);
|
super(getActivity(), R.layout.search_history_list_item, list);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue