AsyncTask's get() method: Is there any scenario where it is actually the best option?

后端 未结 9 534
臣服心动
臣服心动 2020-12-14 02:31

After answering this question, I got a doubt about the sense/usefulness of using the get() method of Android\'s AsyncTask class.

public final Result get ()
         


        
9条回答
  •  遥遥无期
    2020-12-14 03:04

    I have an application to edit photos, the user is capable of opening photos from URLs.

    I used an AsyncTask to download the photo from the URL, during this time the UI should be blocked. what i did is I showed a ProgressBar starts the AsyncTask's get() method than hide the ProgressBar..

    It seemed the best and simplest solution for me.

提交回复
热议问题