From 46337945d26196f83d5edd6705d7589e326c29a0 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 22 Jul 2010 12:09:42 +0000 Subject: [PATCH] bug fix git-svn-id: https://osmand.googlecode.com/svn/trunk@386 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- OsmAnd/src/com/osmand/activities/MapActivity.java | 6 +++--- OsmAnd/src/com/osmand/views/FavoritesLayer.java | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) 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(); }