我有以下类扩展Overlay,在我的Google Map中绘制引脚,问题是我如何添加点击监听器,所以当我点击pin时我可以将它重定向到另一个活动?
class MapOverlay extends Overlay
{
private GeoPoint p;
public MapOverlay(GeoPoint p){
this.p = p;
}
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
//---translate the GeoPoint to screen pixels---
Point screenPts = new Point();
mapView.getProjection().toPixels(p, screenPts);
//---add the marker---
Bitmap bmp = BitmapFactory.decodeResource(
getResources(), R.drawable.pushpin);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);
return true;
}
}