I need to do something when the user clicks the ImageButton
I\'ve tried to create a static class that implements both OnClickListener
There are many solutions for this problem, the best one for me is to eliminate totally the setOnClickListener and inside the onTouchListener do check if the action is ACTION_UP and then inside that check if the last before that is ACTION_DOWN:
case MotionEvent.ACTION_UP:
if (lastAction == MotionEvent.ACTION_DOWN) {
//code for click
.
.
lastAction = event.getAction();
}
lastAction is int and I update it at the end of each ACTION