views:

168

answers:

1

I've got some Buttons that I want to make un-clickable (but still appear on the screen) until another process (thread) has finished its work ? How would you do this ?

The goal is to avoid my users to keep clicking on this button and so, launching a new thread every time they click on it ...

Thanks for your help.

Hubert

+4  A: 
  1. Don't use Threads unless you really have to. Use AsyncTask instead.
  2. Use setEnabled on your Button in onPreExecute and onPostExecute.
Felix