我希望隐藏我的图标来自启动器,它工作在20 sdk以下但不能工作不超过21 sdk,我的代码在下方隐藏图标:
PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName(getApplicationContext(), MainActivity.class);
p.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
可见图标代码
PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName(getApplicationContext(), MainActivity.class);
p.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
答案 0 :(得分:0)
您可以通过删除此行
将其从AndroidManifest中删除<category android:name="android.intent.category.LAUNCHER"/>