3

I have a use case in my application, where after certain point, I need to associate an data with an activity. So whenever an intent with an action and the data type is fired, my activity can be opened. I know that it is possible to associate a data type with an activity statically via AndroidManifest.xml.

Is it possible to register the data type for an activity dynamically and programatically ? Any pointers are appreciated.

1 Answer 1

7

Is it possible to register the data type for an activity dynamically and programatically ?

No.

If the <intent-filter> you want is known in advance, but you only want to enable it after a certain point, you may be able to achieve this via <activity-alias> (have it disabled at the outset and enable it programmatically via PackageManager). Alas, <intent-filter> does not appear to be something you can enable or disable, at least based on what I see in the manifest documentation.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah! You're correct. I would really like to see this feature in android.
This helped me to fit one of my use case regarding launcher screen. Thanks !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.