Associate file type with android application

I am trying to associate my application with a specific file type ( .stl). The recommendation here from Kevin has no effect. When I try to run a file from the file manager, my application is not one of the suggested options.

His code:

<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>

(Also, I have stl not pdf). I have tried all the variations of this theme that I can find.

The system does not know that my application is available to open such a file. Am I doing something stupid?

Thanks so much for any suggestions.

EDIT:

I have an answer. Basically you should specify that you allow any old mimetype type and rely on the file extension. Using the "correct" mimetype (application / sla) does not work. It works:

<data android:scheme="file" 
      android:mimeType="*/*" 
      android:pathPattern=".*\\.stl" />

, Astro, , .

+5
1

(.stl).

, Android . Android MIME .

.

, - :

# 1: MIME, .stl

# 2: MIME <activity> android:mimeType

№3: MIME, .stl

3, , .

Android, iOS , "" . , Android, .

<data android:scheme="file" android:pathPattern=".*\\.stl" /> <data> , , , . android:host="*" - Android pathPattern file, , , . , , .

+1

All Articles