事件分发原理
屏幕事件会由Linux通过JNI传给WMS(WindowManagerService
),然后由WMS传给Activity,最终经过PhoneWindow->DecorView开始往下分发。
View的事件分发
View的事件分发核心源码为 dispatchTouchEvent()
方法:
public boolean dispatchTouchEvent(MotionEvent event) {
// If the event should be handled by accessibility focus first.
if (event