Set a boolean variable when the button has been pressed and check the boolean is false in the on click listener so that you don't process it once it's already been clicked
On Fri, Mar 11, 2011 at 6:54 PM, pabbot <[email protected]> wrote: > Hi all, > > In my application, when I click on a button that inserts a record on > the database and closes the Activity, sometimes it takes long to close > that Activity and some users are clicking on the Button twice. That > causes that the record is inserted twice in the database. > > Is there any way of avoiding this behavior? > > Thanks in advance! > > -- > 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 -- 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

