Android Programming Tutorials

(Romina) #1
Here a Post, There a Post

super(marker);
this.marker=marker;

item=new OverlayItem(status, "Tweet!", statusText);

populate();
}

@Override
protected OverlayItem createItem(int i) {
return(item);
}

@Override
public void draw(Canvas canvas, MapView mapView,
boolean shadow) {
super.draw(canvas, mapView, shadow);

boundCenterBottom(marker);
}

@Override
protected boolean onTap(int i) {
Toast.makeText(StatusMap.this,
item.getSnippet(),
Toast.LENGTH_SHORT).show();

return(true);
}

@Override
public int size() {
return( 1 );
}
}

Now, when you view the map, you will see the pin at the spot of the


location:


241
Free download pdf