AsyncTask?????????????
???????????? ???????[ 2016/4/7 13:34:47 ] ?????????????????? AsyncTask
????1. AsyncTask ??????????????????????????????????μ?????????????????
????AsyncTask????з????????裬???????????????????????Щ?????????????ó???????????????????????????Щ??????
????1) ????AsyncTask
????2) ???AsyncTask?ж???????????????????
????onPreExecute()?? ?÷???????????????????????UI thread???á???????÷????????Щ????????????????????????????????
????doInBackground(Params...)?? ????onPreExecute ??????к???????У??÷???????????????С?????????????????Щ??????????????????????? publishProgress???????????????????????÷???????????????????????
????onProgressUpdate(Progress...)????publishProgress?????????ú?UI thread?????????????????????????????????????????????????????????????
????onPostExecute(Result)?? ??doInBackground ???????onPostExecute ????????UI thread?????????????????????÷????????UI thread.
???????????????AsyncTask???????????????????????
????1) Task???????????UI thread?д???
????2) execute??????????UI thread?е???
????3) ???????????onPreExecute()?? onPostExecute(Result)??doInBackground(Params...)?? onProgressUpdate(Progress...)????????
????4) ??task?????????Σ??????ε?????????????
????doInBackground??????onPostExecute?????????????????????????AsyncTask?????????????б??????????????doInBackground?????????????????????????????????????doInBackground?????onPostExecute??????????
????2. Asynctask ?????????
????1) AsyncTasks??????????
????Asynctask ??????????????????activity ???????????????μ?? ????????????????AsyncTask??Activity??????AsyncTask????????????????????????????????е??????????У?????????????????ó???AsyncTask?????????????????????AsyncTask.cancel()?????????
????????????????????? AsyncTask?????????????????????????????????app?????????????????й???????????????AsyncTask???????????????????app???????????κ?????
????????????????cancel() ?? ?δ?????????????????????????doInBackgroud????????????ж???????????BitmapFactory.decodeStream()??????????????????????
????2?????й?
???????AsyncTask???????Activity???????????????AsyncTask??????????????AsyncTask??Activity?????á????Activity??????????AsyncTask????????????У??????????????????????????????Activity?????????????????й???
????3????????
????????????Activity???????????????????Activity?????′??????????е?AsyncTask??????????Activity???????????????????Ч?????????onPostExecute()?????????潫??????Ч??
????4?????л??????
????Android 1.6????汾??AsyncTask????е????1.6??2.3??汾?????????е????2.3????汾???????????????????к???У??????????????????????execute()??????????????????У???????executeOnExecutor(Executor)??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11