tags:

views:

104

answers:

2

I have a layout which contains five TextView. When user clicks any of the five TextView, it will do the same thing: open another activity. So, the OnClickerListener behavior to the five TextView is the same. Is it possible that I only add OnClickListerner to one view, e.g. to layout, so I don't have to add OnClickListerner to each of the five TextView? Put it another way, if none of the children components receives CLICK event, will the CLICK event passed through to their parent, the layout?

Thanks.

+1  A: 

I don't believe there is another place to automatically receive click inputs from all views in a layout.

You could extend TextView with your custom OnClick behavior.

Or, just pass the same OnClickListener instance to all of your text boxes.

Mayra
A: 

You can add an OnClickerListener to almost any view as far as I know.

disretrospect