Skip to content Skip to sidebar Skip to footer

Enable Or Disable Launch Intent-filter Activities With One Button

I have an app with several activities, they all have a launch intent-filter in the manifest so they can show several icons on the launcher, there is a main activity and the rest o

Solution 1:

You can query the PackageManager to determine if a component is enabled or not:

PackageManager pm = getPackageManager();
ComponentName cn = new ComponentName(...);
ActivityInfo info = pm.getActivityInfo(cn, 0);
if (info != null && info.enabled) {
    // Component is enabled
    ...
} else {
    // Component is disabled
    ... 
}

Post a Comment for "Enable Or Disable Launch Intent-filter Activities With One Button"