diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index a87ab95735..19fba1128e 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -872,7 +872,7 @@ public class MeasurementToolFragment extends Fragment { private void cancelModes() { if (editingCtx.getOriginalPointToMove() != null) { cancelMovePointMode(); - } else if (editingCtx.getSelectedPointPosition() != -1) { + } else if (!isSelectedPointMenuOpened() && editingCtx.getSelectedPointPosition() != -1) { cancelAddPointBeforeOrAfterMode(); } } @@ -1477,6 +1477,15 @@ public class MeasurementToolFragment extends Fragment { } } + private boolean isSelectedPointMenuOpened() { + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null) { + Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag(SelectedPointBottomSheetDialogFragment.TAG); + return fragment != null; + } + return false; + } + public static boolean showInstance(FragmentManager fragmentManager, MeasurementEditingContext editingCtx) { try { MeasurementToolFragment fragment = new MeasurementToolFragment();