I was troubleshooting a view-related issue: a click listener that is not fired when it's supposed to. After a long session of trial-and-error, I found out that a parent view was disabled, thus discarding all events to its children.
Is there a way, in Android, to find exactly what happens to a touch or click event when it is injected to the app? Like how was it dispatched, which views were traversed by it, who ignored it (and why), who discarded it (and why) and finally who consumed it.
Ideally it would be some kind of low-level dump on Logcat emitted for every click in the app.
As you can see in the similar post at the issue tracker Dianne Hackborn writes:
There currently isn't a way to do this.
Meaning, there is no such an API in the framework.
But you can have a custom root ViewGroup
and listen for each and every touch event (via onInterceptTouchEvent()
) and dump the MotionEvent
.
I believe that's the only possible way so far.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With