I have a bit of doubt. I am using an image button (e.g. Play icon in media player). I want to know which action Listener I am supposed to use, onClickListener or onTouchListener. What is the difference between those two actions and when should I use either.
Share
onClickListeneris used whenever a click event for any view is raised, say for example: click event for Button, ImageButton.onTouchListeneris used whenever you want to implement Touch kind of functionality, say for example if you want to get co-ordinates of screen where you touch exactly.Update:
Just check the official doc for both: onClickListener and onTouchListener.
So from official doc, definition for both are: