git-svn-id: https://osmand.googlecode.com/svn/trunk@386 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-07-22 12:09:42 +00:00
parent 5caaa1a60d
commit 46337945d2
2 changed files with 7 additions and 6 deletions

View file

@ -701,7 +701,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
updateApplicationModeSettings(); updateApplicationModeSettings();
favoritesLayer.reloadFavorites(); favoritesLayer.reloadFavorites(this);
poiMapLayer.setFilter(OsmandSettings.getPoiFilterForMap(this)); poiMapLayer.setFilter(OsmandSettings.getPoiFilterForMap(this));
backToLocation.setVisibility(View.INVISIBLE); 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(); Toast.makeText(MapActivity.this, getString(R.string.fav_points_edited), Toast.LENGTH_SHORT).show();
} }
helper.close(); helper.close();
favoritesLayer.reloadFavorites(); favoritesLayer.reloadFavorites(MapActivity.this);
} }
}); });
if(ar.length == 0){ if(ar.length == 0){
@ -1294,7 +1294,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
.show(); .show();
} }
helper.close(); helper.close();
favoritesLayer.reloadFavorites(); favoritesLayer.reloadFavorites(MapActivity.this);
} }
}); });
builder.create().show(); builder.create().show();

View file

@ -2,6 +2,7 @@ package com.osmand.views;
import java.util.List; import java.util.List;
import android.content.Context;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.graphics.Paint; import android.graphics.Paint;
@ -71,7 +72,7 @@ public class FavoritesLayer implements OsmandMapLayer {
paintBlack.setStrokeWidth(2); paintBlack.setStrokeWidth(2);
pixRect.set(0, 0, view.getWidth(), view.getHeight()); pixRect.set(0, 0, view.getWidth(), view.getHeight());
reloadFavorites(); reloadFavorites(view.getContext());
} }
@Override @Override
@ -79,8 +80,8 @@ public class FavoritesLayer implements OsmandMapLayer {
} }
public void reloadFavorites(){ public void reloadFavorites(Context ctx){
FavouritesDbHelper helper = new FavouritesActivity.FavouritesDbHelper(view.getContext()); FavouritesDbHelper helper = new FavouritesActivity.FavouritesDbHelper(ctx);
favouritePoints = helper.getFavouritePoints(); favouritePoints = helper.getFavouritePoints();
helper.close(); helper.close();
} }