当前位置:网站首页>Activity的启动流程
Activity的启动流程
2022-07-23 09:58:00 【ErwinNakajima】
1、根Activity的启动流程。
(1)点击桌面APP图标,Launcher进程采用Binder IPC的方式向system_server进程的AMS(ActivityManagerService)发起startActivity的请求。
(2)system_server进程接收到请求后,采用Socket IPC向Zygote进程发出创建APP进程的请求;
Zygote进程fork出新的进程,即APP进程;
(3)APP进程通过Binder IPC向system_server进程发起attachApplication请求;
system_server进程在接收到请求后,进行一系列的准备工作后,再通过Binder IPC向APP进程发送scheduleLaunchActivity的请求
(4)APP进程接收到请求后,通过Handler向主线程发送LAUNCH_ACTIVITY消息,创建目标Activity,进入Activity的生命周期
ActivityManagerProxy是AMS的远程接口,ApplicationThreadProxy是ApplicationThread的远程接口。
2、进程内启动Activity。
普通Activity启动过程涉及几个进程?AMS所在进程(system_server)和APP进程
APP进程通过Binder IPC向system_server进程发起请求
system_server在接收到请求后,进行一系列准备工作(解析Activity,处理启动参数),再通过Binder IPC向APP进程发送消息
APP进程在接收到请求后,创建目标Activity,进入Activity的生命周期。

如对此有疑问,请联系qq1164688204。
推荐Android开源项目
项目功能介绍:RxJava2和Retrofit2项目,添加自动管理token功能,添加RxJava2生命周期管理,使用App架构设计是MVP模式和MVVM模式,同时使用组件化,部分代码使用Kotlin,此项目持续维护中。
项目地址:https://gitee.com/urasaki/RxJava2AndRetrofit2
边栏推荐
- 运维高级作业02
- 什麼是Per-Title編碼?
- Cmake notes
- Supervisor installation and use
- Live classroom system 03 supplement model class and entity
- Leetcode: 17. letter combination of phone number
- 21 - vertical traversal of binary tree
- Russia hopes to effectively implement the "package" agreement on the export of agricultural products
- Reflection invokes transaction methods, resulting in transaction invalidation
- 面试官:生成订单30分钟未支付,则自动取消,该怎么实现?
猜你喜欢
![[test platform development] XVII. The interface editing page realizes the drop-down cascade selection, and binds the module to which the interface belongs](/img/19/de8f4de5adbfcfb62291b8664187fd.png)
[test platform development] XVII. The interface editing page realizes the drop-down cascade selection, and binds the module to which the interface belongs

基于双目相机拍摄图像的深度信息提取和目标测距matlab仿真

QT document reading notes audio example analysis

C thread lock and single multithreading are simple to use

Version correspondence between numpy and pytorch

C# 线程锁和单多线程简单使用

Leetcode: 17. letter combination of phone number

Advanced operation and maintenance 02

LeetCode-227-基本计算器||

Redis | 非常重要的中间件
随机推荐
Mathematical function of MySQL function summary
Head pose estimation principle and visualization_ Loveliuzz's blog - Programmer's Homestead_ Head posture estimation
自研的数据产品迭代了一年多,为什么不买第三方商业数据平台产品呢?
[software test] MQ abnormal test encountered in disk-to-disk work
Leetcode: 17. letter combination of phone number
一道代码题看 CommonJS 模块化规范
直播课堂系统01-数据库表设计
Kettle implémente une connexion de base de données partagée et insère une instance de composant de mise à jour
The best time to buy and sell stocks
21 - vertical traversal of binary tree
[untitled]
Linux scheduled database backup script
Redis | 非常重要的中间件
Postgresql快照优化Globalvis新体系分析(性能大幅增强)
Building personal network disk based on nextcloud
What is per title encoding?
Russia hopes to effectively implement the "package" agreement on the export of agricultural products
什麼是Per-Title編碼?
Common JS modular specification from a code question
面试官:生成订单30分钟未支付,则自动取消,该怎么实现?