Home > Software engineering >  Associating a file type with the application
Associating a file type with the application

Time:12-06

I've seen many stackoveflow answers in the same topic, but all of them (atleast the ones I've checked) suggest to use intent-filter with the data tag in Android.manifest file.

I'm wondering if it is possible to do this in code? Maybe in the onCreate of the activity.

Some answers I've checked are:

Android intent filter: associate app with file extension

Register to be default app for custom file type

CodePudding user response:

No, its not possible to do it in code. The list of file types you can parse shouldn't change dynamically, either you know how to open a specific type in a specific build or you don't. So there's no reason to do it dynamically, and the system just parses manifests to figure out what apps can open what files.

  • Related