From fdfc13681dd5ab9fc2ebd1bb6032b8b7b77fa57e Mon Sep 17 00:00:00 2001 From: vshcherb Date: Sun, 3 Nov 2013 17:46:22 +0100 Subject: [PATCH] Fix POI edit activity --- .../osmand/plus/activities/NavigatePointFragment.java | 1 - .../osmand/plus/activities/search/SearchActivity.java | 9 --------- .../plus/activities/search/SearchPoiFilterActivity.java | 7 +++++++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java index 5535498305..e52b5d65d3 100644 --- a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java @@ -267,7 +267,6 @@ public class NavigatePointFragment extends SherlockFragment implements SearchAct try { double lat = convert(((TextView) view.findViewById(R.id.LatitudeEdit)).getText().toString()); double lon = convert(((TextView) view.findViewById(R.id.LongitudeEdit)).getText().toString()); - TargetPointsHelper targetPointsHelper = ((OsmandApplication) getActivity().getApplication()).getTargetPointsHelper(); if(mode == ADD_TO_FAVORITE) { Bundle b = new Bundle(); Dialog dlg = MapActivityActions.createAddFavouriteDialog(getActivity(), b); diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java index df43fdb69e..118df3c684 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java @@ -236,15 +236,6 @@ public class SearchActivity extends SherlockFragmentActivity implements OsmAndLo } else { updateSearchPoint(latLon, getString(R.string.search_position_fixed), true); } - } else if (requestCode == SearchPoiFilterActivity.REQUEST_POI_EDIT) { - for(WeakReference ref : fragList) { - Fragment f = ref.get(); - if(f instanceof SearchPoiFilterActivity) { - if(!f.isDetached()) { - ((SearchPoiFilterActivity) f).refreshPoiListAdapter(); - } - } - } } } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java index ca834214dd..db5604a6e7 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java @@ -102,6 +102,13 @@ public class SearchPoiFilterActivity extends SherlockListFragment implements Se updateIntentToLaunch(newIntent); startActivityForResult(newIntent, REQUEST_POI_EDIT); } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + if(requestCode == REQUEST_POI_EDIT) { + refreshPoiListAdapter(); + } + } @Override public void onListItemClick(ListView parent, View v, int position, long id) {