Android hide/unhide app icon programmatically

Hide app’s icon using below code: PackageManager p = getPackageManager(); ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class); // activity which is first time open in manifiest file which is declare as <category android:name=”android.intent.category.LAUNCHER” /> p.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); Here is how to bring back the app’s icon. PackageManager p = getPackageManager(); ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class); p.setComponentEnabledSetting(componentName, … Read more