android 启动launcher流程
来源:互联网 发布:js怎么给标签添加属性 编辑:程序博客网 时间:2024/04/30 04:01
ActivityManagerService.java : switchUser(final int userId)
{
boolean homeInFront = mStackSupervisor.switchUserLocked(userId,uss);
if(homeInFront)
{
startHomeActivityLocked(userId);
}
}
boolean startHomeActivityLocked( int userId) {
Intent intent = getHomeIntent();
...
mStackSupervisor.startHomeActivity(intent,aInfo);
}
Intent getHomeIntent(){
Intent intent = new Intent(mTopAction, mTopData != null ? Uri.parse(mTopData:null));
intent.setComponent()mTopComponent;
...
return intent;
}
设置默认launcher 在 defaultActivity.java
Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.addCategory(Intent.CATEGORY_DEFAULT);
List<ResolveInfo> list = pm.queryIntentActivities(intent,PackageManager.GET_INTENT_FILTERS);
ComponentName[] components = new ComponentName[list.size()];
int defApk = -1;
for(int i = 0; i<list.size(); ++i)
{
ActivityInfo info = list.get(i).activityInfo;
if(info.packageName.equals("com.example.launcher")&&info.name.equals("xxxx"))
{
defApk = i ;
}
components[i] = new ComponentName(info.packageName,info.name);
}
if(defApk != -1){
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_MAIN);
filter.addCategory(Intent.CATEGORY_HOME);
filter.addCategory(Intent.CATEGORY_DEFAULT);
pm.addPreferedActivity(filter, IntentFilter.MATCH_CATEGORY_EMPTY, components, components[defApk] );
}
- android 启动launcher流程
- Android—launcher 启动流程
- Android启动流程——Home Launcher
- Android Launcher启动应用程序流程源码解析
- Android源码(3) --- 系统Launcher 启动流程
- Android Launcher启动应用程序流程源码解析
- Android应用程序从Launcher启动流程
- Android中ICS4.0源码Launcher启动流程分析
- android - home键及launcher启动流程分析
- android - home键及launcher启动流程分析
- Android源码解析之(十)-->Launcher启动流程
- [Android]从Launcher开始启动App流程源码分析
- Android Framework学习(四)之Launcher启动流程解析
- Android源码基础解析之Launcher启动流程
- Android系统开机启动到Launcher流程总结
- Android中ICS4.0源码Launcher启动流程分析【android源码Launcher系列一】
- Android中ICS4.0源码Launcher启动流程分析【android源码Launcher系列一】
- Android中ICS4.0源码Launcher启动流程分析【android源码Launcher系列一】
- Ant编译Java Web项目
- boost::bad_weak_ptr的原因
- AFNetworking2.0源码解析<二>
- 语义化的HTML
- Android数据库高手秘籍(二)——创建表和LitePal的基本用法
- android 启动launcher流程
- C++实现ftp客户端
- 华为练习--查找两个字符串a,b中的最长公共子串
- thinkphp模型过滤查询字段,表达式方法
- 程序设计基础——数据存储与输入输出
- 字节序对其的 问题 实验源码
- C++存储数据结构之一List
- Android内存优化
- 内核态和用户态