根据官方文件:
为了让谷歌能够抓取你的应用程序内容,并允许用户从搜索结果中输入你的应用程序,你必须在应用程序 list 中为相关活动添加意图过滤器.这些意图过滤器允许深入链接到任何活动中的内容.例如,用户可能单击深层链接以查看购物应用程序中描述用户正在搜索的产品的页面.
使用此链接,您将看到如何使用它.
以及如何用这Test Your App Indexing Implementation来测试它.
下面的xml片段显示了如何指定意图过滤 在你的舱单上做深度链接.
<activity
android:name="com.example.android.GizmosActivity"
android:label="@string/title_gizmos" >
<intent-filter android:label="@string/filter_title_viewgizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
<!-- note that the leading "/" is required for pathPrefix-->
<!-- Accepts URIs that begin with "example://gizmos” -->
<data android:scheme="example"
android:host="gizmos" />
</intent-filter>
</activity>
通过Android调试桥进行测试
$ adb shell am start
-W -a android.intent.action.VIEW
-d <URI> <PACKAGE>
$ adb shell am start
-W -a android.intent.action.VIEW
-d "example://gizmos" com.example.android