Answer the question
In order to leave comments, you need to log in
How to programmatically switch clickable focus from a TextView to its containing LinearLayout?
Faced such problem: There is TextView in LinearLayout. When you click on the TextView , the OnClickListener of this element fires, and the OnClickListener of the LinearLayout itself, accordingly, does not fire. How to achieve that, depending on a certain parameter set / reset by pressing an additional button, the OnClickListener of either the layer or the TextView would work.
LinearLayout{
TextView
}
ДругойLayout{
Button
}
Answer the question
In order to leave comments, you need to log in
You need to make your LinearLayout clickable:yourLinearLayout.setClickable(true);
If you need to override the standard behavior of the system - the best option would be to override the reaction to the parent for the parent - in the above case, this is LinearLayout. extend the LinearLayout class and define onInterceptTouchEvent, onTouchEvent and dispatchTouchEvent in it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question