Saturday, 7 September 2013

Do Button events in Android really have to be explicitly disabled?

Do Button events in Android really have to be explicitly disabled?

So I'm new to Android and have this wee app that has a variety of Buttons.
The buttons do a variety of things, but of particular interest are the
buttons that intent to another activity.
Because as I'm happily programming and testing along, I discover that I
can double- and sometimes triple-tap these buttons.
I look for methods on the Button object that will allow me to specify the
number of clicks that the button is allowed or whether the button should
be (even briefly) disabled after a click. I find nothing of the sort.
Incredulous, I begin googling for a high-level discussion of this strange
behavior. I find no interesting discussions, just suggestions about how to
handle the issue on every single button in my app.
With a heavy sigh, I surrender to the time demands of my project, and add
private variables to my activities (no static locals in Java. crap.),
which the click-handling method uses to tell whether it's already busy
handling a button click.
But still I wonder. Do Button events in Android really have to be
explicitly disabled?

No comments:

Post a Comment