diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java index 9bfe58324a..3e4093d253 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java @@ -307,7 +307,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew { FavoritePointEditor editor = getFavoritePointEditor(); if (editor != null && helper != null) { if (editor.isNew()) { - doAddFavorite(name, category, description, color, backgroundType, iconId); + doAddFavorite(name, category, description, address, color, backgroundType, iconId); } else { doEditFavorite(favorite, name, category, description, address, color, backgroundType, iconId, helper); } @@ -341,7 +341,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew { } } - private void doAddFavorite(String name, String category, String description, @ColorInt int color, + private void doAddFavorite(String name, String category, String description, String address, @ColorInt int color, BackgroundType backgroundType, @DrawableRes int iconId) { OsmandApplication app = getMyApplication(); FavouritesDbHelper helper = getHelper(); @@ -350,6 +350,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew { favorite.setName(name); favorite.setCategory(category); favorite.setDescription(description); + favorite.setAddress(address); favorite.setColor(color); favorite.setBackgroundType(backgroundType); favorite.setIconId(iconId); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index 3214817780..7500a17d77 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java @@ -817,11 +817,15 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { hideKeyboard(); MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { + MapContextMenu mapContextMenu = mapActivity.getContextMenu(); if (includingMenu) { mapActivity.getSupportFragmentManager().popBackStack(); - mapActivity.getContextMenu().close(); + mapContextMenu.close(); } else { mapActivity.getSupportFragmentManager().popBackStack(); + if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) { + mapContextMenu.show(); + } } } } @@ -932,17 +936,6 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { private void exitEditing() { cancelled = true; dismiss(); - showContextMenu(); - } - - private void showContextMenu() { - MapActivity mapActivity = getMapActivity(); - if (mapActivity != null) { - MapContextMenu mapContextMenu = mapActivity.getContextMenu(); - if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) { - mapContextMenu.show(); - } - } } private AlertDialog.Builder createWarningDialog(Activity activity, int title, int message, int negButton) {