美文网首页Android Utils
Android 启动 Launcher

Android 启动 Launcher

作者: 几千里也 | 来源:发表于2017-02-09 13:59 被阅读58次

在 ActivityManagerService 里启动 Launcher

Lollipop/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

    Intent getHomeIntent() {
        Intent intent = new Intent(mTopAction, mTopData != null ? Uri.parse(mTopData) : null);
        intent.setComponent(mTopComponent);
        if (mFactoryTest != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
            intent.addCategory(Intent.CATEGORY_HOME);
        }
        return intent;
    }

    boolean startHomeActivityLocked(int userId, String reason) {
        // ... 
        Intent intent = getHomeIntent();
        // ... 
    }

参考文章

Android系统默认Home应用程序(Launcher)的启动过程源代码分析

相关文章

网友评论

    本文标题:Android 启动 Launcher

    本文链接:https://www.haomeiwen.com/subject/chivqttx.html