StupidBeauty
Read times:1596Posted at: - no title specified

单个安卓活动(Activity)的生命周期

Graphviz源代码

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 opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4