From a810c531f438b1181385a1ca70c6f95532c357be Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Sun, 10 Apr 2016 11:05:35 +0300 Subject: [PATCH] Fix #2430 --- .../mapcontextmenu/other/DestinationReachedMenu.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenu.java index e0fec04f8d..c56dda3e6f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/DestinationReachedMenu.java @@ -1,5 +1,7 @@ package net.osmand.plus.mapcontextmenu.other; +import android.support.v4.app.Fragment; + import net.osmand.plus.activities.MapActivity; import net.osmand.plus.mapcontextmenu.BaseMenuController; @@ -10,7 +12,10 @@ public class DestinationReachedMenu extends BaseMenuController { } public static void show(MapActivity mapActivity) { - DestinationReachedMenu menu = new DestinationReachedMenu(mapActivity); - DestinationReachedMenuFragment.showInstance(menu); + Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag(DestinationReachedMenuFragment.TAG); + if (fragment == null || fragment.isDetached()) { + DestinationReachedMenu menu = new DestinationReachedMenu(mapActivity); + DestinationReachedMenuFragment.showInstance(menu); + } } }