如何隐藏android app图标
发布网友
发布时间:2022-03-26 21:33
我来回答
共1个回答
热心网友
时间:2022-03-26 23:02
1,AndroidManifest.xml文件中在入口Activity的intent-filter里去掉,或者将LAUNCHER改为DEFAULT
2,在程序中加入下面的代码
显示图片:
PackageManager
p
=
getPackageManager();
p.setComponentEnabledSetting(getComponentName(),
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
隐藏图标:
PackageManager
p
=
getPackageManager();
p.setComponentEnabledSetting(getComponentName(),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
//显示应用图标
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
//隐藏应用图标