事件不会传递到听者 [英] Event not delivered to listener

查看:1156
本文介绍了事件不会传递到听者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个libgdx游戏使用 scene2d 的UI。我有几个的ImageButton 情况下有自己的 ClickListener 。在某些设备(只看到它三星Galaxy S3和三星Galaxy S4主动至今)有与事件某个问题而被传递,除非有人点击快两倍。

I have a libgdx game that uses scene2d for the UI. I have several ImageButton instances with its own ClickListener. On some devices (only seen it on Samsung Galaxy S3 and Samsung Galaxy S4 Active so far) there is a problem with the event not being delivered unless one clicks twice quickly.

每次点击失败像被记录以下内容:

Every time a click fails something like the following is logged:

04-22 16:10:09.678: D/InputReader(728): Input event: value=1 when=20897610551000
04-22 16:10:09.678: I/InputReader(728): Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.889 ] when=20897610612000
04-22 16:10:09.678: I/InputDispatcher(728): Delivering touch to: action: 0x0
04-22 16:10:09.678: I/InputDispatcher(728): Delivering touch to: action: 0x3
04-22 16:10:09.688: W/InputEventReceiver(728): Attempted to finish an input event but the input event receiver has already been disposed.
04-22 16:10:09.688: W/InputEventReceiver(728): Attempted to finish an input event but the input event receiver has already been disposed.
04-22 16:10:09.688: V/WindowManager(728): Window{43478730 u0 Keyguard}mOrientationRequetedFromKeyguard=false
04-22 16:10:09.698: D/STATUSBAR-StatusBarManagerService(728): manageDisableList what=0x0 pkg=WindowManager.LayoutParams
04-22 16:10:09.788: D/InputReader(728): Input event: value=0 when=20897720902000
04-22 16:10:09.788: I/InputReader(728): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=20897720902000

我想声明的试图完成一个输入事件,但已被配置在输入事件接收器。在这里是关键,但我真的不能明白为什么它会工作时,一按一个更多很快的时间。

I assume the statement Attempted to finish an input event but the input event receiver has already been disposed. is key here, but I can't really see why it would work when one click one more time quickly.

还有什么比这样做的原因是什么?我该如何调试这进一步去的这条底线?任何线索?

What could the reason for this be? How can I debug this further to get to the bottom of this? Any clues?

编辑:除了两个最后的所有日志行出现在触摸了下来,而最后两个出现在触摸起来。我的事件监听器是在点击。

All log lines except the two last ones appears on touch down, while the last two appears on touch up. My event listener is for on click.

推荐答案

我发现了什么是造成问题。我有href="http://$c$c.google.com/p/android/issues/detail?id=62537" rel="nofollow">音量按键错误的奇巧与 http://stackoverflow.com/a/21253443/467650 ,的 https://plus.google.com/+MichaelLeahy/posts/CqSCP653UrW )。

I found out what was causing the problem. I had issues with the volume button bug in KitKat and had added a variant of the workarounds (http://stackoverflow.com/a/21253443/467650, https://plus.google.com/+MichaelLeahy/posts/CqSCP653UrW).

我能够运行,消除了导航栏的处理程序之前减少延迟时间来解决我的双碰的问题,但是这一次没有工作不够好,与奇巧。我当然可以检查正在运行的应用程序的Andr​​oid版本,但作为解决方法是真的哈克开始与我删除它一起。

I was able to get around my "double touch" problem by decreasing the time delay before running the handler that removes the navigation bar, but that again didn't work well enough with KitKat. I could of course check the Android version of the running the app, but as the workaround is really hacky to begin with I removed it all together.

这篇关于事件不会传递到听者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆