事件未送达听众

Roy*_*erg 6 android libgdx

我有一个libgdx游戏使用scene2d的UI.我有几个ImageButton自己的实例ClickListener.在某些设备上(目前仅在三星Galaxy S3和三星Galaxy S4 Active上看到它),除非快速点击两次,否则事件无法发送.

每次单击失败时都会记录以下内容:

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
Run Code Online (Sandbox Code Playgroud)

我假设语句尝试完成输入事件但输入事件接收器已经被处理掉.这里是关键,但我真的不明白为什么一次点击一次就可以了.

这可能是什么原因?我怎样才能进一步调试这个到底?有线索吗?

编辑:除了最后两个之外的所有日志行都在触摸下方显示,而最后两个在触摸时出现.我的事件监听器用于点击.

Roy*_*erg 1

我找出了导致问题的原因。我遇到了KitKat 中音量按钮错误的问题,并添加了变通办法(/sf/answers/1487741041/、https://plus.google.com/+MichaelLeahy/posts/CqSCP653UrW)。

我能够通过减少运行删除导航栏的处理程序之前的时间延迟来解决“双击”问题,但这对于 KitKat 来说仍然不够好。我当然可以检查正在运行的应用程序的 Android 版本,但由于解决方法一开始就非常棘手,所以我将其全部删除。