Java 单击.mp3链接时打开我的Android应用程序
我正在尝试创建一个活动,当我在浏览器中单击.mp3链接时,该活动将打开 以下是我的意向过滤器:Java 单击.mp3链接时打开我的Android应用程序,java,android,intentfilter,Java,Android,Intentfilter,我正在尝试创建一个活动,当我在浏览器中单击.mp3链接时,该活动将打开 以下是我的意向过滤器: <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category andro
<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:scheme="file" />
<data android:scheme="http" />
<data android:host="*" />
<data android:mimeType="application/mp3" />
</intent-filter>
没有任何效果。作为替代方案,您也可以尝试以下方法:
<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:scheme="content" />
<data android:scheme="file" />
<data android:pathPattern=".*mp3" />
<data android:mimeType="audio/*" />
</intent-filter>
它不起作用,因为我放了:
在意图过滤器的内部。现在我的活动中只有多个意图过滤器
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="*"
android:pathPattern=".*.mp3"
android:scheme="http" />
</intent-filter>