码迷,mamicode.com
首页 > 移动开发 > 详细

Android start_activity流程

时间:2014-12-09 10:36:36      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:android   activity   system_server.   

好了,用上篇介绍的工具,跟踪了下startActivity在system_server中的流程,如下:

The picture below is the flow chart for how the source Activity start a target activity

Major includes four steps:
(1) Preparation, flow chart in blue;
(2) suspend the source activity, in yellow;
(3) Start the target application process once not yet created, also create the
Activity Thread, in Aubergine;
(4) Attach the target activity thread to application, in red, in this step,
application onCreate and activity onCreate are invoked.


System_server中的ActivityStack很重,里面维护了所有的activity的状态的栈,由于时间关系,没有深入研究。Application的onCreate主要是创建植根与此Application上的各个组件的Context。

有一点心得是如果要比较深入了解,必须自己去debug跟踪下,看别人的博客永远只是参考,而且容易打瞌睡。

bubuko.com,布布扣


Android start_activity流程

标签:android   activity   system_server.   

原文地址:http://blog.csdn.net/guoguodaern/article/details/41820255

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!