Gesture Listener 1. Declare variable of type GestureDetectorCompat private GestureDetectorCompat mGestureDetectorCompat; 2. Initialize the variable mGestureDetectorCompat = new GestureDetectorCompat(this, new GestureDetector.SimpleOnGestureListener()) 3. Override the methods mGestureDetectorCompat = new GestureDetectorCompat(this, new GestureDetector.SimpleOnGestureListener() { @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if ((e1.getX() > e2.getX())) { //load meme when swiped R2L loadMeme(); } return super.onFling(e1, e2, velocityX, velocityY); } }); NOTE: You can override other methods as well. 4. Override the OnTouchEvent() in the main activity @Override public boolean onTouchEvent(MotionEvent event) { mGestureDetectorCompat.onTouchEvent(event); return super.onTouchEvent(event); }