1、声明GestureDetector
2、实例化GestureDetector,GestureDetector(Context context, GestureDetector.OnGestureListener listener)
3、创建一个类,实现OnGestureListener 接口
4、重写Activity的public boolean dispatchTouchEvent (MotionEvent ev)
public boolean dispatchTouchEvent(MotionEvent ev) {
detector.onTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}