【发布时间】:2021-02-24 18:42:19
【问题描述】:
我不知道如何正确表达这个问题。不过我会尽力的。当我在手机网络浏览器中单击直接视频链接示例 (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>
【问题讨论】:
标签: android kotlin media-player mime open-with