AsyncTask block UI thread and show progressbar with delay

后端 未结 3 1783
粉色の甜心
粉色の甜心 2020-12-07 02:44

My AsyncTask is blocking block button element while downloading image and progress dialog is shown with delay - its shows for a while before image is shown, but downloading

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 03:28

    It is because you are calling AsyncTask#get:

    Waits if necessary for the computation to complete, and then retrieves its result.

    You should perform whatever operation you need to use the image for within onPostExecute()

提交回复
热议问题