There is another way that works even on Android3.1 +. You cannot disable the icon itself, but you can disable one component of the application. Thus, disabling application launch activity will cause its icon to be removed from the launch.
The code for this is simple:
ComponentName componentToDisable = new ComponentName("com.helloandroid.apptodisable", "com.helloandroid.apptodisable.LauncherActivity"); getPackageManager().setComponentEnabledSetting( componentToDisable, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
You can find out about this solution several times:
1 - a disabled component will not start in any way
2 other uninfected actions will be launched from other applications
3 - the application can disable only its component. There is a permission of "android.permission.CHANGE_COMPONENT_ENABLED_STATE", but it does not work, third-party messages cannot have this permission.
4 - the icon will disappear only after restarting the launcher, so the next time you restart the phone, you probably need to restart the restart of the launcher.
Therefore, the application should be launched at least on time.
Link:
Removing an application icon from the launcher
source share