Android全局搜索Content Provider仅接收Prime Provider参数问题求助
Android TV 全局搜索Content Provider未获取用户搜索输入
我已按官方文档为TV应用启用全局搜索功能,但Content Provider的query方法中,selectionArgs仅包含「Prime Provider」,未携带用户实际触发搜索的输入值。
有没有其他开发者遇到过该问题,或是了解Android TV搜索行为的变更信息?
相关配置及日志如下:
Searchable配置
<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配置
<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>
Content Provider查询日志
Projection: content://com.my.app.search/search_suggest_query?limit=10 Selection: ? Selection Args: prime provider Selection Args Size: 1
内容的提问来源于stack exchange,提问作者Rui Pedro Costa
相关产品推荐
相关产品推荐

