4

Possible Duplicate:
Android long-touch event

See screenshot:

enter image description here

Standard deal. Two buttons and TextView. I handle OnClick for button and value goes up/down all works nice.

Would be even nicer if I can code "OnPressAndHold" and update UI with incremental time periods. Like on TimePicker when you click and hold it would increment/decrement values repeatedly. Any pointers?

Community
  • 1
  • 1
katit
  • 17,375
  • 35
  • 128
  • 256
  • 2
    A simple pointer: override onTouch, use a thread/timed message/etc so that every x ms you increment. Start the thread/etc on down, then stop at up. – Ray Britton Jun 30 '11 at 19:03
  • You should be able to use the long press event with a while loop: http://developer.android.com/reference/android/view/View.OnLongClickListener.html Not sure off hand how to tell when the user has lifted their finger, but something like this post should help you out: http://stackoverflow.com/questions/6272409/stop-onlongclicklistener-from-firing-while-dragging – wajiw Jun 30 '11 at 19:17

0 Answers0