我希望我的应用程序能够打开http://www.example.com
and https://www.example.com
.
这有效:
<data
android:host="www.example.com"
android:path="/"
android:scheme="http"/>
<data
android:host="www.example.com"
android:path="/"
android:scheme="https"/>
是否可以通过一次条目捕获两者?我试过:
<data
android:host="www.example.com"
android:path="/"
android:scheme="http*"/>
但这只捕获了 http 链接,而不是 https 链接。
所以我知道如何处理机器人变体,但想使用尽可能最简洁的写作。
这似乎对我有用:
<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="http" />
<data android:scheme="https" />
<data android:host="www.mywebsite.com" />
<data android:pathPrefix="/mypage.php" />
</intent-filter>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)