gpt4 book ai didi

android - 从单个 Activity 在 android 中实现深度链接

转载 作者:太空狗 更新时间:2023-10-29 15:53:38 26 4
gpt4 key购买 nike

虽然我已经在谷歌上浏览了应用索引的相关文档

https://developers.google.com/app-indexing/webmasters/details

但仍然感到困惑的是,如果我想接收有关启动器 Activity 的传入数据,并且可以根据对传入 url 的一些内部解析来控制并启动相关 Activity/fragment 。

最佳答案

您必须在单独的 <intent-filter> 中声明操作、类别和数据标签,与启动器规范不在同一个标​​签中。

 <activity>
<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="your.domain.com"
android:scheme="http" />
</intent-filter>
</activity>

关于android - 从单个 Activity 在 android 中实现深度链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20560916/

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