Android ???????????
???????????? ???????[ 2013/5/14 13:43:47 ] ????????
???????磬???AsyncTask??????????????
????[java] view plaincopyprint?
????public void onClick(View v) {
????new DownloadImageTask().execute("http://example.com/image.png");
????}
????private class DownloadImageTask extends AsyncTask {
????/** The system calls this to perform work in a worker thread and
????* delivers it the parameters given to AsyncTask.execute() */
????protected Bitmap doInBackground(String... urls) {
????return loadImageFromNetwork(urls[0]);
????}
????/** The system calls this to perform work in the UI thread and delivers
????* the result from doInBackground() */
????protected void onPostExecute(Bitmap result) {
????mImageView.setImageBitmap(result);
????}
????}
????public void onClick(View v) {
????new DownloadImageTask().execute("http://example.com/image.png");
????}
????private class DownloadImageTask extends AsyncTask {
????/** The system calls this to perform work in a worker thread and
????* delivers it the parameters given to AsyncTask.execute() */
????protected Bitmap doInBackground(String... urls) {
????return loadImageFromNetwork(urls[0]);
????}
????/** The system calls this to perform work in the UI thread and delivers
????* the result from doInBackground() */
????protected void onPostExecute(Bitmap result) {
????mImageView.setImageBitmap(result);
????}
????}
????????UI???????????????????????????????????е????????UI????????????????
????????òο?AsyncTask??????????????????????????????????????????????裺
????· ????????generics?Task??????????????????????
????· ????doInBackground()?????????????????????С?
????· ????onPreExecute()??onPostExecute()??onProgressUpdate????UI????е??á?
????· ????doInBackground()?????????????onPostExecute()??????
????· ???????doInBackground()?????????publishProgress()???????÷??????????UI????е?onProgressUpdate()?????????????????????????????????
????· ?????????????????????????????????С?
???????????????????????仯(???????????????)???????????????????????????????????????£????????????????????????ο?Android????????Shelves???????????????μ?????
??????д“?????”????
???????Щ????£????д????????????????????????????????????????“?????”???
????“?????”???????????÷??????????????—???????“??”??Service?е?????????????IBinder??????????е???IBinder????????????÷?????????????????е???????С??????????????????????????????ú????IBinder?????????????????е???????(??y????е?UI???)?????IBinder??????????磬???Service??onBind()???????????Service?????UI????е????????onBind()????????(?????????????RPC??????????)????????????????????????С?????Service???????????????????????????????е???????????IBinder?????????????????IBinder???????????????????????
?????????????Content Provider???????????????????????????????????ContentResolver??ContentProvider?????????????Щ????????????????????????????Щ????????query()?? insert ()?? delete ()?? update () ??getType() ?????Щ????????Content Provider?????????????????????С???????Щ???????в????????????????????????Щ???????????????????
????????????
????Android??????????????(RPC)????????????(IPC)??????????????Activity?????????????????????????????÷?????????????????????????(??????)?????????????????????????????????????ú????????????????Σ???????ò???????????????????????????????????????????????1???????????з????????????????????????Android???????????Щ????????????????д???????????????????????????????????
?????????y???????(IPC)??????????????bindService()???????Service??
??????
???·???
??????????????????
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