Tuesday 17 March 2015

Hide the app's icon after installed one apk


                               
                                              Hide app's icon inside the Home's Screen

     Hide the app's icon after installed one apk.(hide application icon in home)



PackageManager p = getPackageManager();

        ComponentName componentName = new ComponentName(this, com.talentcodeworks.callrecorder.CallRecorder.class);        p.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
       


Explanation : -


PackageManager p = getPackageManager();  // p Reference for the PackageManager


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);

No comments:

Post a Comment