tags:

views:

37

answers:

1

Hi, I'm writing a custom compound control that extends RelativeLayout. Inside this component, there is an ImageView. I add a OnClickListener to this ImageView to animate it when the user clicks on it. But when I am in an activity using this control and I add a OnClickListener on the control, this listener is never called. It only works when I remove the other listener I have on the ImageView. Does anybody knows how to "propagate" the event to the other listeners when I catch it inside the control?

Thanks!

PS: I would also like to know if there is an existing control that looks like the icons on the Android desktop. Like an icon with text underneath.

A: 

Try setting one of these to true on your component:

android:clickable

android:focusable

android:focusableInTouchMode

android:longClickable

android:descendantFocusability

I had the same problem when I putted a button inside a ListView, I had to change one of the parameters to make the row be clickable, not only the button.

PHP_Jedi
This solution did not work, I had to override the setOnClickListener method for my component, and create an internal OnClickListener inside the class to dispatch the click event.
Simon