Android 四大组件 之 start_activity流程

好了,用上篇介绍的工具,跟踪了下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跟踪下,看别人的博客永远只是参考,而且容易打瞌睡。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值