AsyncTask not do onPostExecute()

Posted by brian on Stack Overflow See other posts from Stack Overflow or by brian
Published on 2012-03-21T03:55:54Z Indexed on 2012/03/21 5:29 UTC
Read the original article Hit count: 102

Filed under:
|

I write a AsyncTask as below:

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();
}
}

And the other method as below:

public void click() {
new Load().execute();
while(wait) {
;
}
}

The wait is a global boolean value.

© Stack Overflow or respective owner

Related posts about android

Related posts about asynchronous