Can't Override onPostExecute() method in AsyncTask Class or get it to trigger Can't Override onPostExecute() method in AsyncTask Class or get it to trigger android android

Can't Override onPostExecute() method in AsyncTask Class or get it to trigger


OnPostExecute() takes an argument (the object you return from doInBackground()). Change it to protected void onPostExecute(Void v). If you don't provide the argument, the method signatures do not match and the override annotation starts to complain that there is no function to override with this signature.


Try:

In the class try right click Source -> Override/Implement methods.. and look for the onPostExecute() method. It will give you complete method with all types of arguments should it get.


if you want your onPostExecute() to be overitten, simply use what was returned in your doInBackground() as an object in your onPostExecute().

For example...

    @Override    protected void doInBackground(Void...args0){        // your code here...        return value;    }    @Override    protected void onPostExecute(void value){        //code to run    }