onPostExecute not called after completion AsyncTask

mlevit picture mlevit · Aug 31, 2010 · Viewed 42k times · Source

For some reason my onPostExecute() is not called after my AsyncTask finishes.

My class decleration:

public class setWallpaperForeground extends AsyncTask<String, Integer, Boolean>

My onPostExecute():

protected void onPostExecute(Boolean result)

Everything works fine, my doInBackground() completes successfully and returns a Boolean but then it just finishes.

Thanks

Answer

Konstantin Burov picture Konstantin Burov · Aug 31, 2010

Did you start the task with execute() method? The onPostExecute wouldn't run if you just invoke the doInBackground.