How does a motion event gets associated with a certain view? is It the window manager, phone manager or view class? I am facing a problem which is: i am sending motionEvents using sendPointerSync from instrumentation class i can see the events being consumed in my log but i cant see the interaction on my emulator window.
Share
You implement the
OnTouchListenerinterface in YourViewClass then yousetOnTouchListener(yourViewInstance).Then you’ll get the MotionEvents in the
onTouchmethod.Edit
From what I understand, the window manager dispatches the events to the views in the following way. When you touch something, it sends the event to the view that is responsible for drawing this part. As stated in the docs http://developer.android.com/guide/topics/ui/ui-events.html the
Using instrumentation, you’ll send the events to the activity you want to test, and the events are dispatched according to the view layout. Of course, you’ll need to register the interfaces for the views to catch the events.
I apologize if that is not what you were looking for.