What I am having:
- I am having a
imageview
on a linear layout. I want to detectonTouch
ofimageview
. - I do not want to use
onClick
because my implementation requires onTouchImageview
is the child of linearLayout
What is happening:
- Two touch events are firing when i click on image one from image and
another from the
linear layout(parent)
Question:
- How can I disable
onTouch
oflinearLayout
(parent)retaining theonTouch
ofImageview
Code:
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
imgUsrClrId.setOnTouchListener(imgSourceOnTouchListener);
}
OnTouchListener imgSourceOnTouchListener= new OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent event) {
Log.d("", "");
return true;
}};