0

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;
Miaoulis Nikos
  • 182
  • 1
  • 15

1 Answers1

0

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.

Yannick Widmer
  • 1,286
  • 3
  • 19
  • 30