开发者

How do I temporarily disable/bypass the Android OnTouchEvent

I'm currently using the event

@Override
public boolean onTouchEvent(MotionEvent ev)
{

To provide feedback from the user for game I'm writing. This event fires off some game control events that take some time to complete (because there is animation involved). The problem I'm having is during the animation if I keep 开发者_C百科touching the screen (AKA firing this event), I will get a timeout error:

10-02 21:58:30.776: ERROR/ActivityManager(67): Reason: keyDispatchingTimedOut

Basically while the animation is running, I do not need this event, although it would be nice to queue it.

What can I do to prevent the timeout and either queue the event, or temporarily disable it?

Thanks.


Are you by any chance blocking the UI thread? There should be absolutely no reason to do what you are asking for (and it's not even possible :)


Beside what Romain said.
You might want to sleep() on your onTouchEvent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜