3

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

Hubert
  • 15,542
  • 18
  • 44
  • 51

1 Answers1

8
  1. Don't use Threads unless you really have to. Use AsyncTask instead.
  2. Use setEnabled on your Button in onPreExecute and onPostExecute.
Felix
  • 86,568
  • 42
  • 148
  • 166