I\'m trying to open any file with a .conf
extension in my android app. Here\'s what I have in my AndroidManifest.xml
:
Remove:
<data android:host="*" />
from both <intent-filter>
entries and:
<data android:pathPattern=".*\\.conf" />
from the content
one.
File extensions are not used much on Android. Starting with Android Q, files are not used much on Android. There is no requirement for a ContentProvider
to put a file-like extension on a content
Uri
, as you can see from the Uri
in your screenshot.
If you wish to support common Intent
actions like ACTION_VIEW
, your best bet is to save the file in a common meta-format (e.g., JSON, XML) with a file extension that matches, then have your <intent-filter>
filter on the corresponding MIME type. You will need to deal with the possibility that the user chooses a file that was not created by your app, though technically you need to deal with that even with your custom extension.