diff --git a/OsmAnd/src/net/osmand/activities/MapActivity.java b/OsmAnd/src/net/osmand/activities/MapActivity.java index 04e819e7a7..8cb4f5120c 100644 --- a/OsmAnd/src/net/osmand/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/activities/MapActivity.java @@ -1298,7 +1298,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso } else if(item == 5){ if(gpxLayer.isVisible()){ gpxLayer.clearCurrentGPX(); - favoritesLayer.getFavorites().setFavoritePointsFromGPXFile(null); + getFavoritesHelper().setFavoritePointsFromGPXFile(null); } else { dialog.dismiss(); useGPXFileLayer(false, null); @@ -1388,7 +1388,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso pt.setName(p.name); pts.add(pt); } - favoritesLayer.getFavorites().setFavoritePointsFromGPXFile(pts); + getFavoritesHelper().setFavoritePointsFromGPXFile(pts); gpxLayer.setTracks(res.locations); } mapView.refreshMap(); @@ -1403,7 +1403,11 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso builder.show(); } - } + } + + public FavouritesDbHelper getFavoritesHelper() { + return ((OsmandApplication)getApplication()).getFavorites(); + } private void useGPXRouting(final LatLon endForRouting, final GPXFileResult res) { Builder builder = new AlertDialog.Builder(this); diff --git a/OsmAnd/src/net/osmand/views/FavoritesLayer.java b/OsmAnd/src/net/osmand/views/FavoritesLayer.java index 51c5ac4f6d..2a64b5b519 100644 --- a/OsmAnd/src/net/osmand/views/FavoritesLayer.java +++ b/OsmAnd/src/net/osmand/views/FavoritesLayer.java @@ -169,10 +169,6 @@ public class FavoritesLayer implements OsmandMapLayer, ContextMenuLayer.IContext return null; } - public FavouritesDbHelper getFavorites() { - return favorites; - } - @Override public String getObjectDescription(Object o) {