I want to count and display on textView how many times I move my finger on the screen I used the following but it counts how many times coordinates have changed
case MotionEvent.ACTION_MOVE:
i++;
txtMoves.setText(String.valueOf(i));
break;
I want to count and display on textView how many times I move my finger on the screen I used the following but it counts how many times coordinates have changed
case MotionEvent.ACTION_MOVE:
i++;
txtMoves.setText(String.valueOf(i));
break;
You have to check for MotionEvent.ACTION_DOWN
and then MotionEvent.ACTION_MOVE
so you need to make some sort of state machine. If you just check for ACTION_DOWN
you will also count clicks.