On Feb 2, 7:42 am, Moto <medicalsou...@gmail.com> wrote:
> But single tap doesn't give my the onUp event I need.  Essentially if
> you hold down a while or scroll the onSingleTapUp is never called...
>
> What I did was overwrite the dispatchTouchEvent(MotionEvent ev) and
> using
> ev.getAction() looked for ACTION_UP. This did the trick...
>
> Thanks for your helpp Phill,
>
> Moto!

I've observed this also in emu 1.0 r2 and on the dev. G1.

If you press down and release without moving in X or Y, you will
receive onSingleTapUp.  But you won't if you press long enough to
receive onLongPress.  At this point, I presume, it's no longer a tap,
and you won't receive onSingleTapUp.

You also won't receive onSingleTapUp if you slide you finger before
releasing: if you press, slide, hold, and then release, you also won't
see the up event via the onGestureListener.

Sometimes the missing UP needs to be discarded.  The following code
works for me:

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        boolean handled = false;
        if (isEnabled()) {
            handled = gestureDetector.onTouchEvent(event) ||
                    event.getAction() == MotionEvent.ACTION_UP;
        }
        return handled || super.onTouchEvent(event);
    }

--
Joe Bowbeer
myspace.com/irishexperience

--~--~---------~--~----~------------~-------~--~----~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to