Howto us Longpress Event in Android

248 views Asked by At

I have a custom view with my own button. the longpress event is triggered after pressing long, thats fine. Now I am looking for a way to do something during the longpress. the longer the user presses the button the more I do something like a accelerator pedal.

My guess so far is to do a background process that counts up until on ACTION_UP is triggered, but perhabs there are simplier ways?

Is there any help from the sdk/api to do that ?

1

There are 1 answers

1
Abhishek Shukla On

Don't get confused between LongPress and Touch. You get ACTION_UP Motion Event in OnTouchListener. And OnLongClickLitener is some what like OnClickListener