【问题标题】:method setSuggestionsAdapter cannot be applied to given types方法 setSuggestionsAdapter 不能应用于给定类型
【发布时间】:2016-06-20 05:17:41
【问题描述】:

我正在尝试this code 来实现搜索活动,但我收到此错误我不知道如何解决它:

Error:(326, 19) error: method setSuggestionsAdapter in class SearchView cannot be applied to given types;
required: CursorAdapter
found: SearchSuggestionsAdapter
reason: actual argument SearchSuggestionsAdapter cannot be converted to CursorAdapter by method invocation conversion

【问题讨论】:

    标签: android search searchview simplecursoradapter


    【解决方案1】:

    我的解决方案是将 SearchView 导入为 import android.widget.SearchView; 如果你import android.support.v7.widget.SearchView;,那么这可能是错误的原因。

    试试这个它的工作。 谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-21
      • 2019-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-01
      • 2013-07-27
      相关资源
      最近更新 更多