Friday, January 20, 2012

Re: [android-developers] why is onDoubleTap being called before second tup's up action?

Kostya Vasilyev wrote:
> Have you tried using MotionEvent.ACTION_CANCEL in the double-tap listener?
>
> GestureDetector has code to reset its internal state in response to this:
>
> https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/GestureDetector.java#L594
>
> I'm thinking you'd need post a handler message to self to get out of the
> current stack state when onDoubleTap is called, and then in response to
> that message, use ACTION_CANCEL to reset the gesture listener and then
> start the activity.
>
> -- Kostya
>

Kostya,

do you mean that in onDoubleTap (MotionEvent e) listener I should
modify "e" by:

e.setAction(MotionEvent.ACTION_CANCEL)

and then "feed" gesture detector with that modified event?

but if it cancels internal state of detector why to use a Handler?

btw I already tried in onDoubleTap to post Runnable that starts
activity and it worked well but I decided it's dirty workaround -
that's why I used onDoubleTapEvent

pskink

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate