Translation of a note once found on the pages of the Internet.
Creating an application that does not appear in the list of applications being launched with the icon is easy. It is enough to place the following lines in the manifest file:
The task of removing the application icon after installation is a bit more cunning. ')
You cannot independently prohibit the display of the icon, but you can prohibit one of the application components:
ComponentName componentToDisable = new ComponentName("ua.at.tsvetkov.myapp", "ua.at.tsvetkov.myapp.YouLauncherActivity"); getPackageManager().setComponentEnabledSetting(componentToDisable, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
Limitations:
A disabled component will not start in any way.
Other non-disabled Activities will be launched from other applications.
An application can turn off only its own component. There is a permission “android.permission.CHANGE_COMPONENT_ENABLED_STATE”, but it does not work, third-party applications do not have this access to this permission.
The icon will disappear after the launcher restarts, so when restarting the phone the next time, force the launcher restart is not recommended.