我不知道如何正确表达这个问题。不过我会尽力的。当我在手机网络浏览器中并单击直接视频链接示例时(https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4)浏览器询问我是否愿意喜欢打开或下载文件。我选择了打开,系统为我提供了一些可以用来打开文件的应用程序。问题是我的应用程序未列出。如果我突出显示并分享链接,我的应用程序就会列出。但是,我希望在打开或共享时都列出它。
在我的清单中,我在 mainactivity 中添加了以下内容:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:scheme="http"
tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:mimeType="video/*"/>
</intent-filter>
<intent-filter android:scheme="http"
tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
</activity>