Android: dynamically mapping data type to activity

I have a use case in my application where, after a certain point, I need to associate data with activity. Therefore, whenever an intent with an action and data type is launched, my activity may be open. I know that you can associate a data type with activity statically through AndroidManifest.xml.

Is it possible to register a data type for activity dynamically and programmatically? Any pointers are appreciated.

+1
source share
1 answer

Is it possible to register a data type for activity dynamically and programmatically?

No.

If the required <intent-filter> is known in advance, but you want to enable it only after a certain point, you can achieve this via <activity-alias> (first disable it and enable it programmatically through the PackageManager ). Alas, <intent-filter> doesn't look like you can enable or disable, at least based on what I see in the manifest documentation.

+4
source

All Articles