-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2019-04-09:请简述从点击图标开始app的启动流程? #24
Comments
我来简单的说下吧: |
1.点击app图标,Launcher进程使用Binder IPC向system__server进程发起startActivity请求; |
|
点击图标后,Launcher向AMS请求打开Activity |
public static void main(String[] args) {
// 1. mainLooper
Looper.prepareMainLooper();
// 2. 创建ActivityThread,执行attach
ActivityThread thread = new ActivityThread();
thread.attach(false);
// 3. Handler
if (sMainThreadHandler == null) {
sMainThreadHandler = thread.getHandler();
}
// 4. loop()
Looper.loop();
}
知识点要建立体系,上面【】部分就是扩展的点。
这些东西都能从App启动流程中找到答案,还有很多扩展的点,就不多说了。上面attach()方法的源码细节也很多,也不赘述了。 |
点击图标 Launcher 会向 binder方式 systemserver 中的activitymanagerservice(ams) 请求startactivity |
推荐一篇优秀的文章 |
No description provided.
The text was updated successfully, but these errors were encountered: