Why does AsyncTask run in the main Thread of an application?

前端 未结 2 1652
庸人自扰
庸人自扰 2020-12-15 07:48

in my application, I have a class for UI stuff, the name of which is \"SettingActivity\".

Then for doing some jobs in background, I bind this UI class(SettingActivi

2条回答
  •  执念已碎
    2020-12-15 08:29

    In fact, I have checked the doc of android, onPreExecute(), onProgressUpdate(Progress...) and onPostExecute(Result) are all "invoked on the UI thread".

    Only the doInBackground(Params...) method is "invoked on the background thread".

提交回复
热议问题