From b59e745b2e4aabc79c5b563e2aa6446173f77ce4 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 25 Nov 2015 13:38:15 +0100 Subject: [PATCH] Fix #1929 --- .../plus/mapcontextmenu/MenuTitleController.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java index f1c7da8ac9..a27302e1aa 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java @@ -1,7 +1,6 @@ package net.osmand.plus.mapcontextmenu; import android.graphics.drawable.Drawable; - import net.osmand.Location; import net.osmand.ResultMatcher; import net.osmand.binary.RouteDataObject; @@ -141,9 +140,15 @@ public abstract class MenuTitleController { public boolean publish(RouteDataObject object) { if (object != null) { OsmandSettings settings = getMapActivity().getMyApplication().getSettings(); - streetStr = RoutingHelper.formatStreetName(object.getName(settings.MAP_PREFERRED_LOCALE.get()), - object.getRef(), object.getDestinationName(settings.MAP_PREFERRED_LOCALE.get())); - + String streetName = object.getName(settings.MAP_PREFERRED_LOCALE.get()); + String ref = object.getRef(); + if(Algorithms.isEmpty(streetName)) { + streetName = ""; + } + if(Algorithms.isEmpty(ref)) { + streetName += ", "+ ref; + } + streetStr = streetName; if (!Algorithms.isEmpty(streetStr)) { MenuController menuController = getMenuController(); if (menuController == null || menuController.displayStreetNameInTitle()) {