【发布时间】:2018-02-20 03:53:44
【问题描述】:
在我的 Manifest 文件中,我确保每当单击指向我的网站的链接并使用 ACTION_VIEW 创建 Intent 时,我的应用都会向用户提供有关应使用什么打开链接的建议.他们通常可以在 Chrome 和我的应用之间进行选择。
现在,我如何添加一个我不希望我的应用打开的 URL,我只想让 chrome 立即打开它(不要求用户在 chrome 和我的应用之间进行选择)
例如,我想保留下面的代码,但修改它以排除“mywebsite.com/promotion”被我的应用打开
<activity
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</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:host="mywebsite.com"
android:scheme="http" />
<data
android:host="mywebsite.com"
android:scheme="https" />
</intent-filter>
</activity>
编辑有人建议这里的答案可能会有所帮助:Exclude few Urls from deeplinking
但这不是因为它是针对一个非常特殊的情况,这不适用于我的情况
【问题讨论】: