1

I override the onTouchEvent method of Activty. In this method i would like to listen to actions: touch and click and give them two different reactions. The problem is when i test my app in emulator, everything works fine. But not in device. As in device, when i just click a button, i don't just get ACTION_DOWN and ACTION_UP but a few ACTION_MOVE signals after ACTION_DOWN.

Jonik
  • 80,077
  • 70
  • 264
  • 372
Frank Cheng
  • 5,928
  • 9
  • 52
  • 80
  • Answered here: [How to distinguish between move and click in onTouchEvent()?](http://stackoverflow.com/questions/9965695/how-to-distinguish-between-move-and-click-in-ontouchevent) – Jonik Dec 09 '13 at 19:09

1 Answers1

1

Instead of overriding the TouchEvent on your Activity, assign a listener to the Button itself.

View view = getViewById(R.id.entire_view);
view.setOnTouchListener( ...
Paul Nikonowicz
  • 3,883
  • 21
  • 39