From 092da3d2ea6692468415f8499c991001773b4137 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Wed, 9 Sep 2015 15:23:44 +0300 Subject: [PATCH] Fix for editing existing poi crash. --- .../net/osmand/plus/osmedit/EditPoiFragment.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiFragment.java index dde58888a8..cf4881f9ce 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiFragment.java @@ -159,9 +159,7 @@ public class EditPoiFragment extends DialogFragment { toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - FragmentManager fragmentManager = getActivity().getSupportFragmentManager(); - fragmentManager.beginTransaction().remove(EditPoiFragment.this).commit(); - fragmentManager.popBackStack(); + dismiss(); } }); @@ -325,11 +323,7 @@ public class EditPoiFragment extends DialogFragment { if (getActivity() instanceof MapActivity) { ((MapActivity) getActivity()).getMapView().refreshMap(true); } - FragmentManager fragmentManager = - getActivity().getSupportFragmentManager(); - fragmentManager.beginTransaction().remove(EditPoiFragment.this) - .commit(); - fragmentManager.popBackStack(); + dismiss(); } }, getActivity(), mOpenstreetmapUtil); @@ -515,9 +509,7 @@ public class EditPoiFragment extends DialogFragment { if (n != null) { EditPoiFragment fragment = EditPoiFragment.createInstance(n, amenity); - activity.getSupportFragmentManager().beginTransaction() - .add(R.id.fragmentContainer, fragment, "EditPoiFragment") - .addToBackStack(null).commit(); + fragment.show(activity.getSupportFragmentManager(), TAG); } else { AccessibleToast.makeText(activity, activity.getString(R.string.poi_error_poi_not_found),