From 4c04c7ee19e1b8681d421e3c5ad6ccd2477de442 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Mon, 1 Mar 2021 15:48:07 +0200 Subject: [PATCH] change2 --- .../plus/mapcontextmenu/editors/PointEditorFragment.java | 7 ++++--- .../mapcontextmenu/editors/PointEditorFragmentNew.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java index c8309cf8d4..fa8d62fb88 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java @@ -139,8 +139,9 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment { public boolean onTouch(final View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_UP) { FragmentManager fragmentManager = getFragmentManager(); - if (fragmentManager != null) { - SelectFavoriteCategoryBottomSheet.showInstance(getChildFragmentManager(), getTargetFragment()); + SelectFavoriteCategoryBottomSheet dialogFragment = createSelectCategoryDialog(); + if (fragmentManager != null && dialogFragment != null) { + dialogFragment.showInstance(getChildFragmentManager(), getTargetFragment()); } return true; } @@ -178,7 +179,7 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment { } @Nullable - protected BottomSheetDialogFragment createSelectCategoryDialog() { + protected SelectFavoriteCategoryBottomSheet createSelectCategoryDialog() { PointEditor editor = getEditor(); if (editor != null) { return SelectFavoriteCategoryBottomSheet.createInstance(editor.getFragmentTag()); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index 8fd97cbf38..3b7768db5c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java @@ -194,7 +194,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment implemen public void onClick(View v) { FragmentManager fragmentManager = getFragmentManager(); SelectFavoriteCategoryBottomSheet dialogFragment = createSelectCategoryDialog(); - if (fragmentManager != null) { + if (fragmentManager != null && dialogFragment != null) { dialogFragment.showInstance(getChildFragmentManager(), getTargetFragment()); } }