Does making parent clickable make all child element clickable as well? Does making parent clickable make all child element clickable as well? android android

Does making parent clickable make all child element clickable as well?


You answered your first question with your second question. A clickEvent will be delivered to the lowest child element in the layout hierarchy. If this element does not have an onClick behaviour it will pass the event up to its parent until the event gets handled.

Therefore you can treat the LinearLayout as one single block for your onClick behaviour.If you create another clickable element inside the layout be sure to make it big enough to reduce the chance of the user missing the correct item.