diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 9744e8a561..4038ce7b73 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -50,6 +50,7 @@ public class FavouritesDbHelper { protected static final String HIDDEN = "HIDDEN"; private static final String DELIMETER = "__"; + private boolean favoritesLoaded; public FavouritesDbHelper(OsmandApplication context) { this.context = context; @@ -91,12 +92,15 @@ public class FavouritesDbHelper { saveCurrentPointsIntoFile(); } favouritesUpdated(); - + favoritesLoaded = true; } private void favouritesUpdated() { } + public boolean isFavoritesLoaded() { + return favoritesLoaded; + } private boolean merge(Map source, Map destination) { boolean changed = false; diff --git a/OsmAnd/src/net/osmand/plus/views/FavouritesLayer.java b/OsmAnd/src/net/osmand/plus/views/FavouritesLayer.java index f63581001f..62cab78807 100644 --- a/OsmAnd/src/net/osmand/plus/views/FavouritesLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/FavouritesLayer.java @@ -108,7 +108,7 @@ public class FavouritesLayer extends OsmandMapLayer implements ContextMenuLayer. @Override public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) { cache.clear(); - if (this.settings.SHOW_FAVORITES.get()) { + if (this.settings.SHOW_FAVORITES.get() && favorites.isFavoritesLoaded()) { if (tileBox.getZoom() >= startZoom) { float iconSize = FavoriteImageDrawable.getOrCreate(view.getContext(), 0, true).getIntrinsicWidth() * 3 / 2.5f;