单个安卓活动(Activity)的生命周期
digraph activityLifecycle
{
bgcolor = "skyblue:peachpuff" ;
activityStarted [ label = "活动已被启动" , shape = Mcircle , fillcolor = steelblue1 , style = filled ];
onCreate [ label = "onCreate()" , fillcolor = azure , style = filled , shape = box ];
onStart [ label = "onStart()" , fillcolor = azure , style = filled , shape = box ];
onResume [ label = "onResume()" , fillcolor = azure , style = filled , shape = box ];
activityIsRunning [ label = "活动正在运行" , shape = Mcircle , fillcolor = burlywood1 , style = filled ];
appProcessKilled [ label = "应用程序进程\n已被杀死" , shape = Mcircle , fillcolor = burlywood1 , style = filled ];
onRestart [ label = "onRestart()" , fillcolor = azure , style = filled , shape = box ];
onPause [ label = "onPause()" , fillcolor = azure , style = filled , shape = box ];
activityShutDown [ label = "活动已关闭" , shape = Mcircle , fillcolor = burlywood1 , style = filled ];
hiddenNodePushOnStopLeft [ style = invis ];
hiddenNodePushOnPauseDown [ style = invis , label = "" ];
hiddenNodePushOnStopDown [ style = invis , label = "" ];
onStop [ label = "onStop()" , fillcolor = azure , style = filled , shape = box ];
onDestroy [ label = "onDestroy()" , fillcolor = azure , style = filled , shape = box ];
activityStarted -> onCreate -> onStart -> onResume -> activityIsRunning ;
onStart -> onRestart [ dir = "back" ];
activityIsRunning -> onPause [ label = "另一个活动\n进入前台状态" , headport = n , tailport = s ];
activityIsRunning -> hiddenNodePushOnPauseDown -> onPause [ style = invis ];
onPause -> onResume [ label = "用户返回\n到此活动" , tailport = e , headport = e ];
onPause -> onStop [ label = "此活动\n不再可见" ];
onPause -> hiddenNodePushOnStopDown -> onStop [ style = invis ];
onStop -> onRestart [ label = "用户导航\n到此活动" ];
onPause -> appProcessKilled [ label = "更高\n权限\n的应用\n需要\n内存" , tailport = w , headport = s ];
onStop -> appProcessKilled [ label = "更高\n权限\n的应用\n需要\n内存" , tailport = w , headport = s ];
onStop -> hiddenNodePushOnStopLeft [ style = invis ];
appProcessKilled -> onCreate [ label = "用户导航\n到此活动" ];
appProcessKilled -> activityIsRunning [ style = invis ];
onStop -> onDestroy [ label = "该活动正在终结\n或者正在被系统销毁" ];
onDestroy -> activityShutDown ;
{ rank = same ; onStart , onRestart };
{ rank = same ; appProcessKilled , activityIsRunning };
{ rank = same ; onStop , hiddenNodePushOnStopLeft };
}
dot ActivityLifecycle.dot -o ActivityLifecycle.png -T png
Your opinionsHxLauncher: Launch Android applications by voice commands