There is a LinearLayout with lots of children. When a user touches any of these children, the same method will be called. In order not to implement the same onClickListener for each element, I implemented onClickListener for the parent LinearLayout ONLY .
Now, when I click anywhere in the frame of the parent layout, the desired method is called just like I implemented a listener for all the children.
Q: Can I assume that whenever I implement onClickListener for a parent, all its children will respond to the click event?
Q: What happens if any child has its own onClickListener ? Will there be a collision or click on this element, will there be only its own click event?
android onclick android-linearlayout clickable
sandalone Nov 15 '11 at 10:40 2011-11-15 10:40
source share