diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 6831a4efb4..5fd14c9016 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -24,6 +24,7 @@ import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AlertDialog; import android.util.DisplayMetrics; @@ -89,6 +90,7 @@ import net.osmand.plus.helpers.WakeLockHelper; import net.osmand.plus.inapp.InAppHelper; import net.osmand.plus.mapcontextmenu.MapContextMenu; import net.osmand.plus.mapcontextmenu.MapContextMenuFragment; +import net.osmand.plus.mapcontextmenu.builders.cards.dialogs.ContextMenuCardDialogFragment; import net.osmand.plus.mapcontextmenu.other.DestinationReachedMenu; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenuFragment; @@ -749,6 +751,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } } + public void dismissCardDialog() { + getSupportFragmentManager().popBackStack(ContextMenuCardDialogFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE); + } + @Override public void onDismissDialogFragment(DialogFragment dialogFragment) { if (dialogFragment instanceof DataStoragePlaceDialogFragment) { diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 385fa477fe..f14528cb0f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -921,6 +921,7 @@ public class MapActivityActions implements DialogProvider { menuItemsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { + mapActivity.dismissCardDialog(); ContextMenuItem item = contextMenuAdapter.getItem(position); ContextMenuAdapter.ItemClickListener click = item.getItemClickListener(); if (click != null && click.onContextMenuClick(simpleListAdapter, item.getTitleId(), diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 7892aa3ea5..40d4c16ed6 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -423,6 +423,7 @@ public class MapControlsLayer extends OsmandMapLayer { routePlanButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + mapActivity.dismissCardDialog(); doRoute(false); } });