全局搜索在 Android 4.4 中无法按预期工作 [英] Global search not working as expected in Android 4.4

查看:37
本文介绍了全局搜索在 Android 4.4 中无法按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've got an application that has two search suggestion providers that both extend SearchRecentSuggestionsProvider, and I've set it up correctly in the manifest file with the following Intent filter and meta-data:

<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",所以应该没问题.

The searcable resource includes android:includeInGlobalSearch="true", so that should be fine.

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

And I've obviously got a provider there as well:

<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 音乐)也是如此.

This all worked just fine in Android 4.3 using the Google search application, but I've just updated all my devices to Android 4.4 and I am no longer able to search content within my application. Same thing goes for other applications that worked before the OS update, i.e. Google Play Music.

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

I've found a thread on XDA developers that mentions this as well, if it helps: http://forum.xda-developers.com/showthread.php?p=47472102

有人知道发生了什么或如何修复吗?

Does anyone have any idea what's happening or how it can be fixed?

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

Update: I can confirm that it only occurs on devices with Android 4.4. I've tested on an Android 4.3 device using the latest Google Search update, and it works as expected. Looks like it's a bug in Google's update.

推荐答案

我在 AOSP 中发现了这个提交,可能与以下有关:https://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf3566c165d4a2f356c165d15cf356c15d78d94d94a57f7d1c/a>

I found this commit in AOSP, which might be related: https://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf356c15143ab0583c64682de16d94a57f7dd1c

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

The commit message tells us that this feature was removed due to performance reasons (which might or might not be true, given that it references an internal ticket id and I didn't find a related issue about this on the official bugtracker).

这篇关于全局搜索在 Android 4.4 中无法按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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