Android 全局搜索结果查询始终使用相同的参数 Prime Provider

问题描述 投票:0回答:1

我已按照官方文档为我的应用程序启用搜索功能。我正在记录我的内容提供商收到的值。

在对内容提供商的查询调用期间,selectionArgs 仅包含“Prime Provider”,不包含触发我的内容提供商的系统搜索中设置的值。

其他人是否遇到过此问题或有任何有关搜索行为更改的信息?

提前谢谢您。

如详细信息所示,只需按照有关可搜索电视应用程序的文档所述链接:可搜索电视应用程序

我可以提供相关代码

可与我的应用关联搜索

<searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:includeInGlobalSearch="true"
    android:label="@string/app_label"
    android:searchSuggestAuthority="com.my.app.search"
    android:searchSuggestIntentAction="android.intent.action.VIEW"
    android:searchSuggestIntentData="content://com.my.app.search/search"
    android:searchSuggestSelection=" ?"
    android:searchSuggestThreshold="1"
    android:queryAfterZeroResults="true"
    android:voiceSearchMode="showVoiceSearchButton|launchRecognizer"/>

AndroidManifest.xml 中的提供程序

       <provider
            android:name=".domain.provider.SearchProvider"
            android:authorities="com.my.app.search"
            android:enabled="true"
            android:exported="true">

            <intent-filter>
                <action android:name="android.content.action.SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </provider>

我从内容提供商查询的一些日志

Projection: content://com.my.app.search/search_suggest_query?limit=10
Selection:  ?
Selection Args: prime provider
Selection Args Size: 1
android android-tv
1个回答
0
投票

我对我的 Android 电视盒进行了几次出厂重置,最终发现这是“适用于 Android TV 的 Google TV 应用程序”的问题。

如果我卸载更新,搜索将像以前一样工作。我已经在这里向 Google 报告了错误,如果有任何发现,请添加您的发现。

https://issuetracker.google.com/issues/370332089

© www.soinside.com 2019 - 2024. All rights reserved.