Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I call super.onPostExecute(result) in Android AsyncTask?

I wonder if it has any meaning to call super.onPostExecute(result) or super.onPreExecute in Android AsyncTask? I have been always calling them, but even in Android documentation about AsyncTask (Android API Reference: AsyncTask) they are omitted. So does it make any sense if I call them or not?

like image 751
Andranik Avatar asked Dec 17 '13 14:12

Andranik


People also ask

How many times an instance of AsyncTask can be executed?

AsyncTask instances can only be used one time.


1 Answers

No, there is no need to call the superclass. If you take a look at the AsyncTask source, you will see that the super class does nothing:

@SuppressWarnings({"UnusedDeclaration"}) protected void onPostExecute(Result result) { } 
like image 162
diegocarloslima Avatar answered Sep 22 '22 14:09

diegocarloslima