Methods you override that are part of component creation (onCreate()onStart()onResume(), etc.), you should chain to the superclass as the first statement, to ensure that Android has its chance to do its work before you attempt to do something that relies upon that work having been done.

Methods you override that are part of component destruction (onPause()onStop()onDestroy(), etc.), you should do your work first and chain to the superclass as the last thing. That way, in case Android cleans up something that your work depends upon, you will have done your work first.

Methods that return something other than void (onCreateOptionsMenu(), etc.), sometimes you chain to the superclass in the return statement, assuming that you are not specifically doing something that needs to force a particular return value.

Everything else -- such as onActivityResult() -- is up to you, on the whole. I tend to chain to the superclass as the first thing, but unless you are running into problems, chaining later should be fine.

                         -------------------------------------------

during any kind of initialization, let the super class do their work first;
during any kind of finalization, you do your work first

最新文章

  1. Josephus环类问题,java实现
  2. Python 文件编码(文件乱码)
  3. iOS开发UI篇—xib的简单使用
  4. SVM 简要推导过程
  5. android: 将程序运行到手机上
  6. [转]非OpenVZ下利用谷歌TCP-BBR协议单边加速你的VPS
  7. Python_爬虫3
  8. 用指针将字符串a的内容复制到字符串b
  9. JAVA $ JSP
  10. php中设置时区
  11. CentOS 7.0 启动多个MySQL实例(mysql-5.7.21)
  12. 微信小程序1
  13. angular 获取ng-repeat完成状态 $last
  14. zabbix-3.4.10系列
  15. Navicat Premium 12如何激活
  16. ppt正文排版
  17. 快速排序的理解和实现(Java)
  18. hadoop学习day3 mapreduce笔记
  19. 终于解决了贴吧手机版的一个重大BUG
  20. 转:Linux下随机10字符病毒的清除

热门文章

  1. Python学习笔记:输入输出,注释,运算符,变量,数字类型,序列,条件和循环控制,函数,迭代器与生成器,异常处理
  2. Python 基本数据类型 (二) - 字符串1
  3. poj 3187 三角数问题
  4. 奇数结点升序偶数结点降序的单链表排序(Python实现)
  5. SpringMVC之Controller简单使用
  6. urlopen SSL证书验证
  7. filter 作用
  8. goalng导出excel(csv格式)
  9. HDU 1827 强连通 缩点 Summer Holiday
  10. MySQL中的DDL(Data Definition Language,数据定义语言)