在 search.xml 文件中,我有
android:searchSuggestAuthority="com.---.---.MyCustomSuggestionProvider"
但是除非我弄错了,如果你想同时实现最近搜索和自定义搜索,你需要两个不同的内容提供者,那么你如何在你的配置文件中进行设置呢?
一个延伸ContentProvider,一个延伸SearchRecentSuggestionsProvider。这表明我需要两个不同的课程,这是正确的吗?
在 search.xml 文件中,我有
android:searchSuggestAuthority="com.---.---.MyCustomSuggestionProvider"
但是除非我弄错了,如果你想同时实现最近搜索和自定义搜索,你需要两个不同的内容提供者,那么你如何在你的配置文件中进行设置呢?
一个延伸ContentProvider,一个延伸SearchRecentSuggestionsProvider。这表明我需要两个不同的课程,这是正确的吗?
SearchRecentSuggestionsProvider实际上是一个ContentProvider,因为它扩展了ContentProvider。
您应该能够扩展您的类SearchRecentSuggestionsProvider并能够在这两种情况下使用它,而无需复制您的代码。