用户触摸屏幕后,由当前可最顶层的viewGroup的dispatchTouchEvent方法开始传递 spa
以后触发onInterceptTouchEvent方法。接着触发OnTouch事件。 接口
流程以下: 事件
首先触发ACTIVITY的dispatchTouchEvent io
而后触发ACTIVITY的onUserInteraction List
而后触发LAYOUT的dispatchTouchEvent 方法
而后触发LAYOUT的onInterceptTouchEvent。 di
Android中的Gesture识别(detector)是经过GestureDetector.OnGestureListener接口实现的,这个接口的输入就是生成的Touch事件MotionEvent。 view
能够根据你要处理的实际状况,把GestureDetector的onTouchEvent放到以上几个方法中处理。 vi