How can I disable a child from gaining touch input from a ViewGroup? I can’t seem to be able to disable this…
The button keeps getting the pressed events when I press on the ViewGroup.
Any idea how to control the focus and touch events?
I have tried:
setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);
btn.setDuplicateParentStateEnabled(false);

Solution:
Create a custom
ViewGroup, i.e.LinearLayoutorFrameLayoutand overridedispatchSetPressed(...)so that the press event doesn’t propagate to it’s children.Thats it!