From f411cc94c22f33c4965e06923fb2442ca4f9c55f Mon Sep 17 00:00:00 2001 From: Zahnstocher Date: Sun, 15 Mar 2015 12:46:07 +0100 Subject: [PATCH] Fix duplicate favourites again (issue 2400) --- OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java | 2 +- OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index f414d7bb96..35f6c7e98b 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -196,7 +196,6 @@ public class FavouritesDbHelper { } else { builder.setMessage(uiContext.getString(R.string.fav_point_dublicate_message, name)); } - builder.setPositiveButton(R.string.shared_string_ok, null); p.setName(name); return builder; } @@ -231,6 +230,7 @@ public class FavouritesDbHelper { ++index; } + builder.trimToSize(); // remove trailing null characters return builder.toString(); } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java b/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java index 1a151f342c..b8c662a00d 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java @@ -221,6 +221,7 @@ public class FavoriteDialogs { addFavorite(activity, point, helper); } }); + bld.show(); } else { addFavorite(activity, point, helper); }