android中关于调用super的时机
16lz
2021-01-23
Android的官方文档是这样建议的:
对于Activity:
Note: Your implementation of these lifecycle methods must always call the superclass implementation before doing any work, as shown in the examples above.
即首先调用super.detory()
对于App Service:
Unlike the activity lifecycle callback methods, you are not required to call the superclass implementation of these callback methods. 不是强制需要调用,因为在父类service中,是个空实现。
对于Activity:
Note: Your implementation of these lifecycle methods must always call the superclass implementation before doing any work, as shown in the examples above.
即首先调用super.detory()
对于App Service:
Unlike the activity lifecycle callback methods, you are not required to call the superclass implementation of these callback methods. 不是强制需要调用,因为在父类service中,是个空实现。
注意:pmd对于android的检查结果是错误的。
更多相关文章
- Android开发错误——Android Studio中遇到过的错误问题与解决方
- Android 记录一个智障错误
- Mac下发布Unity3d中Android平台下出现“android (invokation fai
- android错误分析集锦
- android开发文档中的一个小错误
- 我的android 第10天 - pull解析Xml文档
- [置顶] Android官方文档系列(翻译)
- Android常见错误处理