You cannot enable, disable, or create <intent-filter> programmatically.
However, in your case, you only have one <intent-filter> for each component. In this case, you can enable and disable the component programmatically, through PackageManager and setComponentEnabledSetting() . In your case, enabling or disabling activity will have the same basic effect as enabling or disabling its <intent-filter> .
CommonsWare
source share