当应super.onResume()被调用?super、onResume

由网友(惧光i)分享简介:在应 super.onResume(); 被调用,上的第一行 onResume()或最后一行?保护无效onResume(){Log.i(MY_DEBUG_TAG,关于恢复);super.onResume();displayDashboard();}解决方案 无论你是否选择调用超级方法取决于是否需要继承的功能。你可以经...

在应 super.onResume(); 被调用,上的第一行 onResume()或最后一行?

 保护无效onResume(){
    Log.i(MY_DEBUG_TAG,关于恢复);
    super.onResume();
    displayDashboard();
}
 

解决方案

无论你是否选择调用超级方法取决于是否需要继承的功能。你可以经常发现,如果你需要调用的API文档的超级方法。

有时候,你需要做一些超级方法被调用之前(即过滤属性或执行一个动作)。有时候你的code已发生超方法已经执行完毕。

这是非常多的具体实施。

我想用c语言编一个程序当输入A时,调用一个音频文件,怎么写

When should super.onResume(); be called, on the first line of onResume() or on the last line?

protected void onResume() {
    Log.i(MY_DEBUG_TAG, "On Resume");
    super.onResume();
    displayDashboard();
}

解决方案

Whether or not you choose to call the super method depends upon whether you require the inherited functionality. You can often find out if you need to call the super method from Api documentation.

Sometimes you need to do something before the super method is called (ie filter an attribute or perform an action). Sometimes your code has to happen after the super method has executed.

It is very much implementation specific.

阅读全文

相关推荐

最新文章