Code example for GestureDetector.SimpleOnGestureListener

	public PassengerRoutesView(Context activity, AttributeSet attrs) {
		super(activity, attrs);
		this.activity = (BusMeActivity) activity;
    	OnGestureListener lis = new SimpleOnGestureListener();
		gestureDetector = new GestureDetector(activity, lis);
		gestureDetector.setOnDoubleTapListener(new MyOnDoubleTapListener());
		this.state = State.CREATE;
	MyOnDoubleTapListener onDoubleTapListener = new MyOnDoubleTapListener();
	public boolean onTouchEvent(MotionEvent e) {
		return gestureDetector.onTouchEvent(e);
    class MyOnDoubleTapListener implements GestureDetector.OnDoubleTapListener {
Connect your IDE to all the code out there  Get Codota for Java