zoukankan      html  css  js  c++  java
  • 安卓生命周期分析

    场景1——Activity之间的跳转:
    第一次进入MainActivity:
    08-24 17:37:03.708: D/LogTag(3243): MainActivity------>onCreate()------------------>
    08-24 17:37:03.732: D/LogTag(3243): MainActivity------>onStart()------------------>
    08-24 17:37:03.733: D/LogTag(3243): MainActivity------>onResume()------------------>

    点击跳转到MainActivity_2:
    08-24 17:37:06.717: D/LogTag(3243): MainActivity------>onPause()------------------>
    08-24 17:37:06.747: D/LogTag(3243): MainActivity_2------>onCreate()------------------>
    08-24 17:37:06.772: D/LogTag(3243): MainActivity_2------>onStart()------------------>
    08-24 17:37:06.773: D/LogTag(3243): MainActivity_2------>onResume()------------------>
    08-24 17:37:07.125: D/LogTag(3243): MainActivity------>onStop()------------------>

    按返回键返回到MainActivity:
    08-24 17:37:10.878: D/LogTag(3243): MainActivity_2------>onPause()------------------>
    08-24 17:37:10.891: D/LogTag(3243): MainActivity------>onRestart()------------------>
    08-24 17:37:10.892: D/LogTag(3243): MainActivity------>onStart()------------------>
    08-24 17:37:10.893: D/LogTag(3243): MainActivity------>onResume()------------------>
    08-24 17:37:11.230: D/LogTag(3243): MainActivity_2------>onStop()------------------>
    08-24 17:37:11.230: D/LogTag(3243): MainActivity_2------>onDestroy()------------------>

    场景2——按Home键:
    第一次进入MainActivity:
    08-24 17:40:23.009: D/LogTag(3243): MainActivity------>onCreate()------------------>
    08-24 17:40:23.065: D/LogTag(3243): MainActivity------>onStart()------------------>
    08-24 17:40:23.069: D/LogTag(3243): MainActivity------>onResume()------------------>

    按Home按键:
    08-24 17:40:31.279: D/LogTag(3243): MainActivity------>onPause()------------------>
    08-24 17:40:31.794: D/LogTag(3243): MainActivity------>onStop()------------------>

    重新进入MainActivity:
    08-24 17:40:36.960: D/LogTag(3243): MainActivity------>onRestart()------------------>
    08-24 17:40:36.961: D/LogTag(3243): MainActivity------>onStart()------------------>
    08-24 17:40:36.961: D/LogTag(3243): MainActivity------>onResume()------------------>

  • 相关阅读:
    Maven插件系列之spring-boot-maven-plugin
    Java中getResourceAsStream的用法
    【redis】【linux】-bash: redis-cli: 未找到命令
    【bat】杀死指定端口
    【bat】查看端口占用情况
    【java】【springboot】nohup: 无法运行命令'java': 没有那个文件或目录
    【springboot】启动指定内存大小
    【java】【spring】源码分析,@AliasFor互为别名
    【idea】设置安装插件位置
    【记录】【springboot】java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal解决
  • 原文地址:https://www.cnblogs.com/leihupqrst/p/5804009.html
Copyright © 2011-2022 走看看