Note that there are some explanatory texts on larger screens.

plurals
  1. POassociate file type with android app fails
    text
    copied!<p>I'm struggling to associate my app with a particular file type (<code>.stl</code>). A recommendation <a href="https://stackoverflow.com/questions/4149032/correct-android-intent-filter-configuration-to-associate-a-file-type-with-an-act" title="here">here</a> 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.</p> <p>His code is:</p> <pre><code>&lt;activity name="com.mycompany.MyActivity"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.VIEW" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;category android:name="android.intent.category.BROWSABLE" /&gt; &lt;data android:mimeType="application/pdf" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>(Except I have stl not pdf). I've tried all the variations on this theme I can find.</p> <p>The system seems unaware that my app is available to open this kind of file. Am I doing something stupid? </p> <p>Many thanks for any suggestions.</p> <p><strong>EDIT:</strong></p> <p>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:</p> <pre><code>&lt;data android:scheme="file" android:mimeType="*/*" android:pathPattern=".*\\.stl" /&gt; </code></pre> <p>Now when I select a file in Astro my app is suggested as one which will open this kind of file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload