In my application, i have set OnTouchListener
and OnClickListener
to an ImageView
.
Problem is when i click an ImageView
both OnTouchListener
and OnClickListener
are working. But i want to avoid the OnTouchListener
when clicked on image, and when dragging the ImageView OnTouchListener
should work and OnClickListener
should be avoided.
Any suggestions...
Below is my code:
imageview.setOnClickListener(m_onClickListner);
imageview.setOnTouchListener(this);
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
}else if (event.getAction() == MotionEvent.ACTION_MOVE) {
}
if (event.getAction() == MotionEvent.ACTION_UP) {
}
return true;
}
OnClickListener m_onClickListner = new View.OnClickListener() {
@Override
public void onClick(View v) {
}
};