Hi,

I have this issue (at least on the Galaxy Tab 10.1 running 3.2 and the 
Nexus 7).

E.g. I have a screen with more two buttons.
When i put two fingers down, one finger on one button, the other on the 
other button, at the same time, both buttons are clicked at the same time. 
I.e. the 'onClick' is called for both of them in rapid succession.

How can I prevent this reliably.

I tried using the 'android:splitMotionEvents="false"' on ViewGroups, on 
various spots in the hierarchy.
I tried calling the 'setMotionEventSplittingEnabled(false)' method for 
these buttons' parent.

All this doesn't work.

The OnClick handlers spawn fragments. However, calling '
fragmentManager.findFragmentByTag(tag)' to see if a fragment has already 
been added doesn't work if the OnClick handlers are called too quickly 
after each other (I guess the commit hasn't finished properly before the 
second OnClick is being called). I could put an additional 'postDelayed' 
call to spawning these fragments, but this solution would be a hack.

Our app's targetSdk is set to 11 and we can't lower this. 

Is there a reliable or proper way to prevent a click of multiple buttons at 
the same time, e.g. a second button won't click when another finger is 
still down on the screen?

Thanks!

-- 
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