I am in a tricky situation, hope you can help me with it. I have few views (TextViews), horizontally placed one after another in a linear layout. When I press on textview1,
You need to handle all your touch events in the LinearLayout and check the location of the child views (child.getLeft() and child.getRight()).
public boolean dispatchTouchEvent(MotionEvent event){
int x = event.getX();
int cc = getChildCount();
for(int i = 0; i < cc; ++i){
View c = getChildView();
if(x > c.getLeft() && x < c.getRight()){
return c.onTouchEvent(event);
}
}
return false;
}