我应该在Android AsyncTask中调用super.onPostExecute(result)吗? [英] Should I call super.onPostExecute(result) in Android AsyncTask?
本文介绍了我应该在Android AsyncTask中调用super.onPostExecute(result)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道在Android AsyncTask中调用super.onPostExecute(result)或super.onPreExecute有什么意义吗?我一直在打电话给他们,甚至在关于AsyncTask的Android文档中( Android API参考: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?
推荐答案
不,不需要调用超类.如果查看 AsyncTask
源,您将看到超类什么也不做:
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) {
}
这篇关于我应该在Android AsyncTask中调用super.onPostExecute(result)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文