Android-更新SDK版本23后,至少添加一个带有ACTION-VIEW Intent过滤器的Activity [英] Android - Adding at least one Activity with an ACTION-VIEW intent-filter after Updating SDK version 23

查看:119
本文介绍了Android-更新SDK版本23后,至少添加一个带有ACTION-VIEW Intent过滤器的Activity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 AndroidManifest.xml 中获得以下工具提示:

I am getting the following tool tip in AndroidManifest.xml:

该应用无法通过Google搜索建立索引;考虑添加至少一个 使用ACTION-VIEW意向填充器进行的活动.请参阅问题说明 更多细节.

App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent-filler. See issue explanation for more details.

添加深层链接,使您的应用进入Google索引, 从Google搜索获取安装并向您的应用发送流量.

Adds deep links to get your app into the Google index, to get installs and traffic to your app from Google Search.

任何人都可以解释为什么会这样吗?

Can anyone explain why it is so?

推荐答案

摘自官方文档:

要使Google能够抓取您的应用内容并允许用户从搜索结果中进入您的应用,您必须在应用清单中添加针对相关活动的意图过滤器.这些意图过滤器允许您在任何活动中深度链接到内容.例如,用户可能单击深层链接以查看购物应用程序中的页面,该页面描述了用户正在搜索的产品.

To enable Google to crawl your app content and allow users to enter your app from search results, you must add intent filters for the relevant activities in your app manifest. These intent filters allow deep linking to the content in any of your activities. For example, the user might click on a deep link to view a page within a shopping app that describes a product offering that the user is searching for.

使用此链接为应用内容启用深层链接,您将了解如何使用它.

Using this link Enabling Deep Links for App Content you'll see how to use it.

并使用此测试您的应用索引实现如何进行测试.

And using this Test Your App Indexing Implementation how to test it.

以下XML代码段显示了如何指定意图过滤器 在清单中进行深层链接.

The following XML snippet shows how you might specify an intent filter in your manifest for deep linking.

<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调试桥进行测试

To test via Android Debug Bridge

$ 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

这篇关于Android-更新SDK版本23后,至少添加一个带有ACTION-VIEW Intent过滤器的Activity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆