Intercepting clicks from subview in Android

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 these 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?


贾斯汀,你可以玩dispatchTouchEvent()或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?

链接地址: http://www.djcxy.com/p/43964.html

上一篇: 下拉currentIndex onchange

下一篇: 拦截Android中子视图的点击次数