What i am trying to do is hiding a installed application from another application like this :
PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName("com.example.activitypackgename","com.example.activitypackgename.LauncherActivity");
p.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
but it is throwing exception
java.lang.SecurityException: Permission Denial: attempt to change component state
code works fine if trying to hide same application. I need to know is their any way to hide a app from another app.? Thanks in advance.