enter code here
AsyncTask类如下:
class Load extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected String doInBackground(String... aurl) {
//do job seconds
//stop at here, and does not run onPostExecute
}
@Override
protected void onPostExecute(String unused) {
super.onPostExecute(unused);
wait = false;
new Load().execute();
}
}
另外一个方法如下:
public void click() {
new Load().execute();
while(wait) {
;
}
}
wait是boolean值。
为什么AsyncTask 不能调用onPostExecute()方法呢?