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?
Edit: 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.
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 (https://stackoverflow.com/a/21253443/467650, https://plus.google.com/+MichaelLeahy/posts/CqSCP653UrW).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With