1
我在应用程序中注册了一个意图过滤器来打开文件类型“.m3u”,它适用于使用文件浏览器选择的本地文件,但它不会显示我的应用程序在“打开“菜单在这些情况下:Android intent过滤器文件类型http
- 如果我点击一个链接到‘M3U’文件
- 如果我下载了‘M3U’文件,然后点击通知栏上打开下载文件(否则的话我浏览downloadde文件,点击它我的应用出现在“open with”菜单上。
在这里,我设置的意图
<!-- LOCAL FILE -->
<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:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.m3u"
android:scheme="file" />
</intent-filter>
<!-- HTTP FILE -->
<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:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.m3u"
android:scheme="http" />
</intent-filter>
我缺少的是清单文件的一部分?
谢谢
嗨@Pecana,我在想你的'android:pathPattern =“。* \\。m3u”'。看看[这个线程](http://stackoverflow.com/questions/13817296/android-intent-filter-pathpattern)。我怀疑这会解决你的问题。 – AuroMetal
不幸的是,它不适用于我:-(我试着用这个和其他类似的解决方案,但似乎没有任何工作:-( – Pecana
对不起,一些变化后一切正常:-)顺便说一下,我仍然无法打开文件,当我点击从通知栏下载的文件有什么区别点击通知栏打开文件和浏览文件anc点击它?谢谢 – Pecana