Prevent ConcurrentModificationException
This commit is contained in:
parent
3b09293e9f
commit
1d5de834f1
2 changed files with 6 additions and 2 deletions
|
@ -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<String, FavouritePoint> source, Map<String, FavouritePoint> destination) {
|
||||
boolean changed = false;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue