Code example for GestureDetectorCompat

0
	 * @param context 
	 */ 
	private void init(Context context) {		
		mGame = new Game(context);
		mGame.addView(this);
		mDetector = new GestureDetectorCompat(context, new MyGestureListener());
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		this.mDetector.onTouchEvent(event);
		return mGame.onTouchEvent(this, event);
	} 
 
	@Override 
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		 
		mGame.draw(canvas, this);
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE