app/src/main/java/fr/neamar/kiss/utils/PackageManagerUtils.java
/**
     * Method to enable/disable a specific component
     */
Method to enable/disable a specific component
Method to enable / disable a specific component
public static void enableComponent(Context ctx, Class component, boolean enabled) {
        PackageManager pm = ctx.getPackageManager();
        ComponentName cn = new ComponentName(ctx, component);
        pm.setComponentEnabledSetting(cn,
                enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                PackageManager.DONT_KILL_APP);
    }
public static void enableComponent ( Context ctx , Class component , boolean enabled ) { PackageManager pm = ctx . getPackageManager ( ) ; ComponentName cn = new ComponentName ( ctx , component ) ; pm . setComponentEnabledSetting ( cn , enabled ? PackageManager . COMPONENT_ENABLED_STATE_ENABLED : PackageManager . COMPONENT_ENABLED_STATE_DISABLED , PackageManager . DONT_KILL_APP ) ; }
Method to enable/disable a specific component
Method to enable / disable a specific component