22

我有一个应用程序,它有两个都扩展的搜索建议提供程序,并且我已经在清单文件中使用以下过滤器和元数据SearchRecentSuggestionsProvider正确设置了它:Intent

<intent-filter>
   <action android:name="android.intent.action.SEARCH" />
</intent-filter>

<meta-data
   android:name="android.app.searchable"
   android:resource="@xml/searchable_tv" />

可搜索资源包括android:includeInGlobalSearch="true",所以应该没问题。

而且我显然也有一个提供者:

<provider
   android:name="com.miz.contentprovider.TvShowContentProvider"
   android:authorities="com.miz.contentprovider.TvShowContentProvider"
   android:exported="true" />

这一切都在使用 Google 搜索应用程序的 Android 4.3 中运行良好,但我刚刚将我的所有设备更新到 Android 4.4,我不再能够在我的应用程序中搜索内容。在操作系统更新之前运行的其他应用程序也是如此,例如 Google Play 音乐。

我在 XDA 开发人员上找到了一个帖子,如果它有帮助的话:http: //forum.xda-developers.com/showthread.php?p=47472102

有谁知道发生了什么或如何解决?

更新:我可以确认它只发生在 Android 4.4 的设备上。我已经使用最新的 Google 搜索更新在 Android 4.3 设备上进行了测试,它按预期工作。看起来这是谷歌更新中的一个错误。

4

3 回答 3

8

我在 AOSP 中发现了这个提交,这可能是相关的: https ://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf356c15143ab0583c64682de16d94a57f7dd1c

提交消息告诉我们,由于性能原因,此功能已被删除(这可能是正确的,也可能不是正确的,因为它引用了一个内部票证 ID,而且我在官方 bugtracker 上没有找到与此相关的问题)。

于 2014-02-07T12:01:39.690 回答
5

我检查了 Google 的联系人,App Indexing正在取代它。文档将被更新以将其显示为已弃用,并且如果没有系统级权限(如 iDev 上面所示),则无法让此功能在 Kit Kat 上运行。

于 2014-01-13T21:34:01.037 回答
1

自上次更新 (v31) 以来,Google Chrome 现在显示为可搜索的应用程序。

系统应用:

有这样的尝试

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.globalsearch" android:sharedUserId="android.uid.shared">
    <uses-permission android:name="android.permission.GLOBAL_SEARCH" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
    <application android:label="@string/global_search" android:process="android.process.acore">
        <activity android:name=".GlobalSearch" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" android:stateNotNeeded="true" android:theme="@android:style/Theme.NoDisplay" android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <!-- This must be higher than the default priority (0), which
is what GoogleSearch uses. -->
            <intent-filter android:priority="500">
                <action android:name="android.search.action.GLOBAL_SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
        </activity>
        <activity android:name=".SearchSettings" android:label="@string/search_settings">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.search.action.SEARCH_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <provider android:name=".SuggestionProvider" android:authorities="com.android.globalsearch.SuggestionProvider" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
        <provider android:name=".StatsProvider" android:authorities="com.android.globalsearch.stats" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
        <meta-data android:name="android.app.default_searchable" android:value=".GlobalSearch" />
    </application>
</manifest>
于 2013-11-23T16:55:06.857 回答