[android-developers] Best way to prevent multiple clicks - multiple activity starts??

2010-10-01 Thread DanH
If I have a button that starts an activity, and the activity sometimes
takes a second or two to throw up its own view, how can I most simply
and reliably protect against the button being clicked multiple times
and kicking off multiple (identical) activities?

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


Re: [android-developers] Best way to prevent multiple clicks - multiple activity starts??

2010-10-01 Thread TreKing
On Fri, Oct 1, 2010 at 12:53 PM, DanH danhi...@ieee.org wrote:

 how can I most simply and reliably protect against the button being clicked
 multiple times and kicking off multiple (identical) activities?


Disable the button on first click, re-enable on return from your activity?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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

Re: [android-developers] Best way to prevent multiple clicks - multiple activity starts??

2010-10-01 Thread Mark Murphy
You could call setEnabled(false) at the point when you call
startActivity(), then setEnabled(true) in onResume() as you're coming
back to the screen.

On Fri, Oct 1, 2010 at 1:53 PM, DanH danhi...@ieee.org wrote:
 If I have a button that starts an activity, and the activity sometimes
 takes a second or two to throw up its own view, how can I most simply
 and reliably protect against the button being clicked multiple times
 and kicking off multiple (identical) activities?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in Atlanta: http://bignerdranch.com/classes/android

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