I have one doubt related to Touch Event Dispatch.
Usually Activity is associated with one Window, so if i use code like somewhat below , events are dispatched properly to corresponding view at those cordinates.
getWindow().getDecoreView().dispatchTouchEvents().
But if some new Windows comes on to screen, (like Dialog or PopUpWindow) how to send events to those window?
Is there any API available for the same?
Any idea , how Android Framework dispatch events to focussed top most window?
If we can expose API from framework for same, any pointer to particular Class or Function?
the event in android is dispatched level by level. The event starts from activity->ViewGroup->View, you can implement these methods to control the event dispatch:
dispatchTouchEvent(MotionEvent)
onTouchEvent(MotionEvent)
onInterceptTouchEvent(MotionEvent)