Code example for GestureDetector.SimpleOnGestureListener

0
    MapView mapView;
 
	public LocationOverlay(Context context, MapView mapView) {
		super(context, mapView);
		this.mapView = mapView;
    	OnGestureListener lis = new SimpleOnGestureListener();
		gestureDetector = new GestureDetector(context, lis);
		gestureDetector.setOnDoubleTapListener(new MyOnDoubleTapListener());
	} 
 
    private class MyOnDoubleTapListener implements GestureDetector.OnDoubleTapListener {
 
		@Override 
		public boolean onDoubleTap(MotionEvent e) {
			Log.d(LOGTAG, "DOUBLE TAP!!");
			mapView.getController().animateTo(LocationOverlay.this.getMyLocation());
			return true; 
		} 
 
		@Override