What is the difference between setOnClickListener and setOnTouchListener?
Interms of:
Edited:
- Performance wise, which is faster to load/respond on the view, and
- Preferable Choice, this similar question, answers my second part very well.
Thanks
What is the difference between setOnClickListener and setOnTouchListener?
Interms of:
Edited:
Thanks
OnTouch is Motionevent. You can drag up,down,left and right. But OnClick is simply focusing,pressing and releasing. When you want to get co-ordinates of screen where you touch the screen, use touchlistener. Just a click event for button and imageview,use OnClickListener.
setOnTouchListener gives you a chance for something to respond before the view does, whereas
setOnClickListener is fired after the view responds.