I have three activity and three Intent Filters for them in the Android Manifest.
An intent filter is an instance of the IntentFilter class. However, since the Android system must know about the capabilities of a component before it can launch that component, intent filters are generally not set up in Java code, but in the application's manifest file (AndroidManifest.xml) as elements. (The one exception would be filters for broadcast receivers that are registered dynamically by calling Context.registerReceiver(); they are directly created as IntentFilter objects.)
source: http://developer.android.com/guide/components/intents-filters.html
Also, see this: https://stackoverflow.com/a/10403074/832776
If your Activity had multiple intent-filter
s then you could disable a specific intent-filter
by creating an activity-alias
with the intent-filter
you want to disable and disable just the Activity alias. See: https://developer.android.com/guide/topics/manifest/activity-alias-element.html
You can neither enable, disable, or create <intent-filter>
s programmatically.
However, in your case, you only have one <intent-filter>
per component. In that case, you can enable and disable the component programmatically, via PackageManager
and setComponentEnabledSetting()
. In your case, enabling or disabling the activity would have the same basic effect as enabling or disabling its <intent-filter>
.