My application has a custom view which contains other custom views of a different type. The subviews have their own click listeners (which I can't change, as the开发者_开发百科se are in 3rd party libraries). How can I intercept a user's click at the level of my view to do some processing, and then pass the click on to the proper subview?
Justin, you can play with dispatchTouchEvent() or onInterceptTouchEvent().
I'm not entirely sure about this, but in Java what I would do is define various subview objects in my main view and simply send those to the draw/paint function. That way I'd only have ONE click listener which would be in the view anyways.
Can you do something like that in Android?
精彩评论