Yes, you need to copy the motion event.  The system owns the one it hands
you, and will recycle it when you return.

On Mon, Jul 20, 2009 at 1:17 AM, Mike <[email protected]> wrote:

>
> Hello,
>
> my app forwards MotionEvents, reported by
> GestureDetector.OnGestureListener, to a worker thread.
> Right now i am doing it by calling MotionEvent.obtain, pass the
> obtained copy to the worker thread, handle it and recycle it at the
> worker thread.
> Is it required to obtain and recycle a MotionEvent if it is passed to
> another thread? Or could it safely be skiped?
> If i am making things overly complicated, could you please explain me
> at which conditions MotionEvent.obtain is usually called?
>
> Thanks,
> Mike.
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to