Is it possible to remove intent filters from activity based on user preference? Say dial intent filter is added and then at later point of time user decides the application should not handle dial.
Edit: Removed add part in question description
An intent filter is an expression in an app's manifest file that specifies the type of intents that the component would like to receive. For instance, by declaring an intent filter for an activity, you make it possible for other apps to directly start your activity with a certain kind of intent.
description: Specifies the types of intents that an activity, service, or broadcast receiver can respond to. An intent filter declares the capabilities of its parent component — what an activity or service can do and what types of broadcasts a receiver can handle.
An intent is an object that can hold the os or other app activity and its data in uri form.It is started using startActivity(intent-obj).. \n whereas IntentFilter can fetch activity information on os or other app activities.
The intent filter specifies the types of intents that an activity, service, or broadcast receiver can respond.
No, it seems they are static.
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.
Source: http://developer.android.com/guide/topics/intents/intents-filters.html#ifs
I thought maybe you could enable/disable via the Package manager, but despite have a GET_INTENT_FILTERS flag in the PackageManager, it seems it's not supported.
The defect has been raised here, and discussion here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With