There is a flag MotionEvent.ACTION_UP and MotionEvent.ACTION_DOWN
You can check by comparing it with event.getAction()
you can use this as
@Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN:
There are many flags. Check MotionEvent
source share