What is "do some stuff" doing? When you make changes to the UI, they don't commit until after the current batch of code fully completes on the UI thread. In your case, "do some stuff" will execute prior to the button being disabled. So if you're doing some lengthy stuff in there, the user might have the chance to click the button again before it gets disabled.
Doug On Jul 6, 5:31 pm, William Ferguson <william.ferguson...@gmail.com> wrote: > I'm finding that some of my users are occasionally getting a button > firing twice in rapid succession (less than 100 millis) even though > the first thing the handler does is to disable the button. ie > > button.addOnClickListener(new OnClickListener() { > public void onClick(View view) { > button.setEnabled(false); > // do some stuff. > } > > }); > > Is this expected behaviour? > Ie that the InputEvents (button clicks) stack and will be sent to a > View even though the View is disabled? > > William -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en