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

后端 未结 9 542
臣服心动
臣服心动 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:02

    I post my own answer, as it is what I think at this moment and nobody has given it.

    My curiosity is still alive, so I wont mark this one as correct. If someone answers this question brilliantly, I will mark his/her answer as correct.

    My answer is that there is actually no scenario where using the AsyncTask's get() method is the best solution.

    IMHO, using this method is pointless. What I mean is that there always seem to be a better solution.

    Likewise, I would say it's semantically shocking, as calling it changes your AsyncTask into an effective "SyncTask".

提交回复
热议问题