2015-05-05 47 views
0

任何人都知道在没有调用super.onPreExecute()的情况下从AsyncTask中的onPreExcute返回有什么影响;剂量doInBackground将被称为 我有一些条件,我不希望线程继续;从onExecute AsyncTask返回而不调用super

+0

什么都不会发生 – San

+0

这不是强制性的,你必须调用'super.onPreExecute()'如果你调用'super.onPreExecute()'之后将会调用'doInBackground()'。 –

回答

1

不,它不会有影响。您可以检查的AsyncTask here

的代码,你可以看到,onPreExecute是:

/** 
    * Runs on the UI thread before {@link #doInBackground}. 
    * 
    * @see #onPostExecute 
    * @see #doInBackground 
    */ 
    protected void onPreExecute() { 
    }