title: Android AsyncTask call onProgressUpdate or onPostExecute delay
body: <pre><code>    class DoLogin extends AsyncTask&lt;String, Integer, String&gt; {// 继承AsyncTask
      @Override
      protected String doInBackground(String... params) {// 处理后台执行的任务，在后台线程执行
          ServerAnalyze.log("消息", "登陆", "手动登陆函数开始启动.");
  
          EditText etStuId = (EditText) findViewById(R.id.tbStudentID);
          EditText etPwd = (EditText) findViewById(R.id.tbPassword);
  
          global.setStudentID(etStuId.getText().toString());
          String Password = etPwd.getText().toString();
          global.setImei(((TelephonyManager) getSystemService(TELEPHONY_SERVICE))
                  .getDeviceId());
          Log.i("loginclick", "bg0");
          global.giitServiceInterface.SendBroadCast_Login(global.getStudentID(), Password, global.getImei());
          Log.i("loginclick", "bg1");
          publishProgress(0);
          Log.i("loginclick", "bg2");
          return "";
      }
  
      protected void onProgressUpdate(Integer... progress) {// 在调用publishProgress之后被调用，在ui线程执行
          Log.i("loginclick", "update");
      }
  
      @Override
      protected void onPostExecute(String result) {// 后台任务执行完之后被调用，在ui线程执行
          // progressDialog.dismiss();
          Log.i("loginclick", "finish");
      }
  
      @Override
      protected void onPreExecute() {// 在doInBackground(Params...)之前被调用，在ui线程执行
  
          Button btnloginButton = (Button) findViewById(R.id.btnlogin);
          btnloginButton.setText("正在登陆中，请稍候...");
          btnloginButton.setBackgroundColor(getResources().getColor(
                  R.color.huise));
      }
  
      protected void onCancelled() {// 在ui线程执行
  
      }
  
  }
  </code></pre>
  
  <p><code></p>
  
  <pre><code>09-22 13:13:09.753: I/loginclick(1751): bg0
  09-22 13:13:09.763: I/loginclick(1751): bg1
  09-22 13:13:09.763: I/loginclick(1751): bg2
  09-22 13:13:09.773: I/Giit Service(1751): Start
  09-22 13:13:24.824: I/loginclick(1751): update
  09-22 13:13:24.824: I/loginclick(1751): finish
  09-22 13:13:24.834: I/[GiitParamClass-Action](1751): 1
  09-22 13:13:24.844: I/[GiitParamClass-BooleanResult](1751): false
  09-22 13:13:24.844: I/[GiitParamClass-intResult](1751): 0
  </code></pre>
  
  <p></code></p>
  
  <p>such this show:</p>
  
  <p>I have a question.</p>
  
  <p>why bg0,bg1,b2 have been log,but onProgressUpdate and onPostExecute need service callback then them run.</p>
  
  <p>09-22 13:13:09 service start</p>
  
  <p>but still 09-22 13:13:24.824 BroadCast call back then onProgressUpdate and onPostExecute start run.</p>
  
  <p>I want to know,why cause that.</p>
  
  <p>I try to search,but I don't known how to write a nice keyword.so I not found anwser.</p>
  
  <p>sincere.thanks.</p>