Fix POI edit activity

This commit is contained in:
vshcherb 2013-11-03 17:46:22 +01:00
parent d195ebc054
commit fdfc13681d
3 changed files with 7 additions and 10 deletions

View file

@ -267,7 +267,6 @@ public class NavigatePointFragment extends SherlockFragment implements SearchAct
try { try {
double lat = convert(((TextView) view.findViewById(R.id.LatitudeEdit)).getText().toString()); double lat = convert(((TextView) view.findViewById(R.id.LatitudeEdit)).getText().toString());
double lon = convert(((TextView) view.findViewById(R.id.LongitudeEdit)).getText().toString()); double lon = convert(((TextView) view.findViewById(R.id.LongitudeEdit)).getText().toString());
TargetPointsHelper targetPointsHelper = ((OsmandApplication) getActivity().getApplication()).getTargetPointsHelper();
if(mode == ADD_TO_FAVORITE) { if(mode == ADD_TO_FAVORITE) {
Bundle b = new Bundle(); Bundle b = new Bundle();
Dialog dlg = MapActivityActions.createAddFavouriteDialog(getActivity(), b); Dialog dlg = MapActivityActions.createAddFavouriteDialog(getActivity(), b);

View file

@ -236,15 +236,6 @@ public class SearchActivity extends SherlockFragmentActivity implements OsmAndLo
} else { } else {
updateSearchPoint(latLon, getString(R.string.search_position_fixed), true); updateSearchPoint(latLon, getString(R.string.search_position_fixed), true);
} }
} else if (requestCode == SearchPoiFilterActivity.REQUEST_POI_EDIT) {
for(WeakReference<Fragment> ref : fragList) {
Fragment f = ref.get();
if(f instanceof SearchPoiFilterActivity) {
if(!f.isDetached()) {
((SearchPoiFilterActivity) f).refreshPoiListAdapter();
}
}
}
} }
} }

View file

@ -103,6 +103,13 @@ public class SearchPoiFilterActivity extends SherlockListFragment implements Se
startActivityForResult(newIntent, REQUEST_POI_EDIT); startActivityForResult(newIntent, REQUEST_POI_EDIT);
} }
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == REQUEST_POI_EDIT) {
refreshPoiListAdapter();
}
}
@Override @Override
public void onListItemClick(ListView parent, View v, int position, long id) { public void onListItemClick(ListView parent, View v, int position, long id) {
final PoiFilter filter = ((AmenityAdapter) getListAdapter()).getItem(position); final PoiFilter filter = ((AmenityAdapter) getListAdapter()).getItem(position);