How do I add a marker on a particular location in the map?
I saw this code that shows the coordinates of the touched location. And I want a marker to pop or be shown in that same location everytime it is touched. How do I do this?
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
if (event.getAction() == 1) {
GeoPoint p = mapView.getProjection().fromPixels(
(int) event.getX(),
(int) event.getY());
Toast.makeText(getBaseContext(),
p.getLatitudeE6() / 1E6 + "," +
p.getLongitudeE6() /1E6 ,
Toast.LENGTH_SHORT).show();
mapView.invalidate();
}
return false;
}