I'm struggling to associate my app with a particular file type (.stl
). A recommendation here from Kevin doesn't have any effect. When trying to launch a file from a file manager, my app isn't one of the options suggested.
His code is:
<activity name="com.mycompany.MyActivity">
<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:mimeType="application/pdf" />
</intent-filter>
</activity>
(Except I have stl not pdf). I've tried all the variations on this theme I can find.
The system seems unaware that my app is available to open this kind of file. Am I doing something stupid?
Many thanks for any suggestions.
EDIT:
I have the answer. Basically you have to state that you are allowing any old mimetype and relying on the file extension. Using the 'correct' mimetype (application/sla) didn't work. This works:
<data android:scheme="file"
android:mimeType="*/*"
android:pathPattern=".*\\.stl" />
Now when I select a file in Astro my app is suggested as one which will open this kind of file.