fix also searchAddressOnline fragment to be origin aware

This commit is contained in:
sonora 2014-12-30 11:41:36 +01:00
parent b2b8851a7b
commit 9bcb3c5611

View file

@ -132,13 +132,14 @@ public class SearchAddressOnlineFragment extends SherlockFragment implements Sea
if (location == null) { if (location == null) {
location = settings.getLastKnownMapLocation(); location = settings.getLastKnownMapLocation();
} }
locationUpdate(location);
} }
@Override @Override
public void locationUpdate(LatLon l) { public void locationUpdate(LatLon l) {
location = l; location = l;
if(adapter != null){ if(adapter != null){
adapter.notifyDataSetInvalidated(); adapter.updateLocation(l);
} }
} }
@ -244,6 +245,12 @@ public class SearchAddressOnlineFragment extends SherlockFragment implements Sea
} }
class PlacesAdapter extends ArrayAdapter<Place> { class PlacesAdapter extends ArrayAdapter<Place> {
private LatLon location;
public void updateLocation(LatLon l) {
location = l;
notifyDataSetChanged();
}
public PlacesAdapter(List<Place> places) { public PlacesAdapter(List<Place> places) {
super(getActivity(), R.layout.search_address_online_list_item, places); super(getActivity(), R.layout.search_address_online_list_item, places);