I want my app to recognize when a user swipes from right to left on the phone screen.
How to do this?
@Edward Brey's method works great. If someone would also like to copy & paste the imports for the OnSwipeTouchListener
, here they are:
import android.content.Context;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;