Android MTK 设置默认启动 Launcher

//Slog.d(TAG,“set default launcher”);

final PackageManager mPm = mContext.getPackageManager();

ArrayList homeActivities = new ArrayList();

ComponentName currentDefaultHome = mPm.getHomeActivities(homeActivities);

ComponentName[]mHomeComponentSet = new ComponentName[homeActivities.size()];

for (int i = 0; i < homeActivities.size(); i++) {

final ResolveInfo candidate = homeActivities.get(i);

//Slog.d(TAG,“homeActivities”+candidate);

final ActivityInfo info = candidate.activityInfo;

ComponentName activityName = new ComponentName(info.packageName, info.name);

mHomeComponentSet[i] = activityName;

}

IntentFilter mHomeFilter = new IntentFilter(Intent.ACTION_MAIN);

mHomeFilter.addCategory(Intent.CATEGORY_HOME);

mHomeFilter.addCategory(Intent.CATEGORY_DEFAULT);

ListActivities=new ArrayList();

mPm.rep

你可能感兴趣的:(Android,经验分享,面试,android)