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

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Hubert
  • 16,012
  • 18
  • 45
  • 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
  • 88,392
  • 43
  • 149
  • 167