2015-05-05 46 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() { 
    }