Search code examples
androidtouch

Who delivering touchEvent to Activity?


I know about touch event flow, when we are talking about Activity:

Activity -> Window -> DecorView -> ViewGroup -> ...

The question is: who delivering touch event to Activity, when user press smth on screen?

Is there any service or manager who respond for it?

Where can i read about it?


Solution

  • In general, a Looper running in ActivityThread receives an input-message from OS and dispatch input-event to the view hierarchy including Activity. Set a break point in onTouchEvent() and see "Frames" in Android Studio Debugger. You can find all the players (classes, methods) relevant to the event-delivery.