diff --git a/OsmAnd/src/com/osmand/activities/MapActivity.java b/OsmAnd/src/com/osmand/activities/MapActivity.java index 480acccf1a..1596f42389 100644 --- a/OsmAnd/src/com/osmand/activities/MapActivity.java +++ b/OsmAnd/src/com/osmand/activities/MapActivity.java @@ -701,7 +701,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso updateApplicationModeSettings(); - favoritesLayer.reloadFavorites(); + favoritesLayer.reloadFavorites(this); poiMapLayer.setFilter(OsmandSettings.getPoiFilterForMap(this)); backToLocation.setVisibility(View.INVISIBLE); @@ -1271,7 +1271,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso Toast.makeText(MapActivity.this, getString(R.string.fav_points_edited), Toast.LENGTH_SHORT).show(); } helper.close(); - favoritesLayer.reloadFavorites(); + favoritesLayer.reloadFavorites(MapActivity.this); } }); if(ar.length == 0){ @@ -1294,7 +1294,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso .show(); } helper.close(); - favoritesLayer.reloadFavorites(); + favoritesLayer.reloadFavorites(MapActivity.this); } }); builder.create().show(); diff --git a/OsmAnd/src/com/osmand/views/FavoritesLayer.java b/OsmAnd/src/com/osmand/views/FavoritesLayer.java index 1953daa868..847d64ed8c 100644 --- a/OsmAnd/src/com/osmand/views/FavoritesLayer.java +++ b/OsmAnd/src/com/osmand/views/FavoritesLayer.java @@ -2,6 +2,7 @@ package com.osmand.views; import java.util.List; +import android.content.Context; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; @@ -71,7 +72,7 @@ public class FavoritesLayer implements OsmandMapLayer { paintBlack.setStrokeWidth(2); pixRect.set(0, 0, view.getWidth(), view.getHeight()); - reloadFavorites(); + reloadFavorites(view.getContext()); } @Override @@ -79,8 +80,8 @@ public class FavoritesLayer implements OsmandMapLayer { } - public void reloadFavorites(){ - FavouritesDbHelper helper = new FavouritesActivity.FavouritesDbHelper(view.getContext()); + public void reloadFavorites(Context ctx){ + FavouritesDbHelper helper = new FavouritesActivity.FavouritesDbHelper(ctx); favouritePoints = helper.getFavouritePoints(); helper.close(); }