4

Given that most email/file-manager/social-app attachments will be resolved to content uri scheme with an "application/octet-stream" mime type, none of registering an intent-filter for a custom extension solutions no longer work. What remains is to let an app register an intent filter for all content which is quite annoying:

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="*"
                android:mimeType="application/*"
                android:pathPattern=".*//.xxx" <!-- this wont work since uri may resolve to smth like this "dat=content://0@media/external/file/692 typ="   ->
                android:scheme="content" />
        </intent-filter>

I set there is API for querying mimetype for extension: https://developer.android.com/reference/android/webkit/MimeTypeMap

Is there API or other way to add new mapping for my extension, i.e. ".ext -> application/ext", which would we recognised on the system level?

sinek
  • 2,458
  • 3
  • 33
  • 55

0 Answers0