Why does AsyncTask execute () have to be called in the user interface thread, although AsyncTask uses Looper.getMainLooper () in innerHandler?

Why is the method AsyncTask execute(Params...)called in the user interface thread, as indicated in the documentation , although AsyncTask uses Looper.getMainLooper () in innerHandler?

I tried to create a task and call its execution (Params ...) from the background thread, and it works fine.

+4
source share
1 answer

Why is the method AsyncTask execute(Params...)called in the user interface thread, as indicated in the documentation, although AsyncTask uses Looper.getMainLooper () in innerHandler?

... AsyncTask Android API 25, . , , .

, , , . , , , - .

(Params...) , .

, , . , .

, onPreExecute() , execute(Params...). , execute(Params...) , , onPreExecute() .

+3

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


All Articles