Android: How would you press the Button buttons for a period?

I have some buttons that I want to make unclickable (but still appear on the screen) until another process (thread) finishes its work? How do you do this?

The goal is to prevent my users from continuing to click on this button, and therefore, launching a new thread every time they click on it ...

+3
source share
1 answer
  • Do not use Threads unless you really like it . Use instead AsyncTask.
  • Use setEnabledon Buttonin onPreExecuteand onPostExecute.
+8
source

Source: https://habr.com/ru/post/1741969/


All Articles