Reputation: 11
I want to write intent-filter that will allow my app to open files with custom files exception. On Android 8 (and before) there was a possibility to do this as intent url was delivered like this (this comes from Chrome downloads screen):
content://com.android.chrome.FileProvider/downloads/somefile.xyz
Now, the same screen on Android 9+ delivers intent like this:
content://media/external/downloads/25
Is there a possibility to detect my file extension with such intent-uri format without writing an intent filter that just detects all intents (*)?
Any help would be appreciated!
Upvotes: 1
Views: 312
Reputation: 1006539
Is there a possibility to detect my file extension with such intent-uri format without writing an intent filter that just detects all intents (*)?
No, sorry.
On Android 8 (and before) there was a possibility to do this as intent url was delivered like this
There is no requirement, on any version of Android, for a content
Uri
to contain a file extension, just as there is no requirement on the Web for an http
or https
URL to contain a file extension.
this comes from Chrome downloads screen
That may be true for a particular version of Chrome. Please do not assume that Chrome will always use a file extension. And please do not assume that every Android device user uses Chrome and only uses Chrome. There is no requirement for other apps to use a content
Uri
with a file extension.
Upvotes: 1