设置默认Launcher

Intent mIntent1 = new Intent("android.ido.intent.action.launcher");
mIntent1.putExtra("packageName",pakName);//pakName:Launcher 包名字符串
mIntent1.putExtra("className",clsName);// // clsName:Launcher 类名字符串
sendBroadcast(mIntent1);
注:下次开机生效,不会再出现选择启动的 Launcher
系统默认的 Launcher:com.android.launcher3,com.android.launcher3.Launcher

AndroidManifest.xml 配置

<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
文档更新时间: 2022-05-25 16:26   作者:Aeeditor