gpt4 book ai didi

Android 在 Intent 中响应 URL

转载 作者:IT老高 更新时间:2023-10-28 12:56:21 24 4
gpt4 key购买 nike

我希望在用户转到某个 url 时启动我的 Intent :例如,android 市场使用 http://market.android.com/ 执行此操作网址。 youtube也是如此。我也希望我的也这样做。

最佳答案

我做到了!使用 <intent-filter> .将以下内容放入 list 文件中:

<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="www.youtube.com" android:scheme="http" />
</intent-filter>

这很好用!

关于Android 在 Intent 中响应 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/525063/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com