首页 > 解决方案 > 我有警告“Google 搜索无法索引应用程序;请考虑添加至少一个带有 ACTION-VIEW 意图过滤器的 Activity。”

问题描述

更新后,工作室出现如下警告:“App is not indexable by Google Search; 考虑添加 ACTION-VIEW 意图过滤器。有关更多详细信息,请参阅问题说明。更多... (Ctrl + F1) » 如何解决?

我的 Api 是 28 岁。

这是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.omen.serverforcofe" >

    <uses-permission android:name="android.permission.NFC"/>
    <uses-feature android:name="android.hardware.nfc" android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <category android:name="android.intent.category.DEFAULT" />
                <data  android:mimeType="text/plain"
                    />
            </intent-filter>

        </activity>
    </application>

</manifest>

标签: javaandroid

解决方案


<activity
    android:name=".MyActivity"
    android:screenOrientation="portrait"
    android:label="@string/app_name">

    <intent-filter>

       <action android:name="android.intent.action.VIEW" />

    </intent-filter>

</activity>

将此意图过滤器添加到应用程序清单中声明的​​活动之一为我解决了这个问题。


推荐阅读