android中关于调用super的时机
16lz
2021-12-04
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的检查结果是错误的。
更多相关文章
- java.lang.ClassCastException: android.app.Application cannot
- Android开发中Android与网页(JavaScrip)t的交互
- Android(安卓)手机震动 设置震动时间
- Android中获得上下文的静态方法
- Android开发错误——Android(安卓)Studio中遇到过的错误问题与解
- Android中利用DisplayMetrics取得手机屏幕大小
- 2011.11.22——— android jni简单用法
- Android(安卓)ListView简单实用
- 2011.11.22——— android jni简单用法