初次运行:onCreate()->onStart()->onResume()
结束运行:onPause()->onStop()->onDestory()
转入后台:onPause()->onStop()
从后台恢复:onRestart()->onStart()->onResume()
有3个Acitivity,分别用One,Two(透明的),Three表示,One是应用启动时的主Activity
启动第一个界面Activity One时,它的次序是
onCreate (ONE) - onStart (ONE) - onResume(ONE)
点"打开透明Activity"按钮时,这时走的次序是
onPause(ONE) - onCreate(TWO) - onStart(TWO) - onResume(TWO)
再点back回到第一个界面,Two会被杀这时走的次序是
onPause(TWO) - onActivityResult(ONE) - onResume(ONE) - onStop(TWO) - onDestroy(TWO)
点"打开全屏Activity"按钮时,这时走的次序是
onPause(ONE) - onCreate(Three) - onStart(Three) - onResume(Three) - onStop(ONE)
再点back回到第一个界面,Three会被杀这时走的次序是
onPause(Three) - onActivityResult(ONE) - onRestart(ONE) - onStart(ONE)- onResume(ONE) - onStop(Three) - onDestroy(Three)
再点back退出应用时,它的次序是
onPause(ONE) - onStop(ONE) - onDestroy(ONE)