Note that there are some explanatory texts on larger screens.

plurals
  1. POIntent filter for custom file type
    primarykey
    data
    text
    <p>I have tried a lot of ways to get an intent filter to detect my custom file type and let me open it from gmail with my program, but nothing works, at least on Android 4.1 (cyanogen mod). Unfortunately I cannot test it on anything else at the moment, but I need it to work on as many versions as possible.</p> <p>This is what I have right now, taken from <a href="https://stackoverflow.com/questions/9518318/android-how-to-create-intent-filter-for-custom-file-extension-that-does-not-make">here</a>, which seems to be the most recent answer on this issue:</p> <pre><code>&lt;intent-filter&gt; &lt;action android:name="android.intent.action.VIEW" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:scheme="file" /&gt; &lt;data android:mimeType="*/*" /&gt; &lt;data android:pathPattern=".*\\.myext" /&gt; &lt;data android:host="*" /&gt; &lt;/intent-filter&gt; </code></pre> <p>I tried other solutions from other questions too but none have worked. I might have missed something, so feel free to suggest the same solutions again if you think they should work, but please don't close as a duplicate.</p> <p>Does anyone have any experience with this on 4.1? I only really care about being able to open it from the gmail app. Opening from other apps, including file browsers, is not important. How can I achieve this and have it work on all Android versions?</p> <p><strong>Update 2:</strong></p> <p>Adding this opens the file in gmail on my device, but when tapping an email in the notifications bar, I get a prompt asking me if I want to open it with gmail or with my app. Also, someone with a 2.3 device told me it doesn't work at all (no save / view buttons in gmail).</p> <pre><code>&lt;intent-filter&gt; &lt;action android:name="android.intent.action.VIEW" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:mimeType="application/*" android:pathPattern=".*\\.myext" android:scheme="content" /&gt; &lt;/intent-filter&gt; </code></pre> <p><strong>Update 1:</strong></p> <p>The answer <a href="https://stackoverflow.com/questions/6656987/android-intent-filter-custom-filetype">here</a> correctly causes my own files to be opened with my app from root explorer. Gmail still does not identify them however.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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