Reputation: 893
The method setSuggestionsAdapter
of a SearchView
gives me a strange Error:
I have a class InformationAdapter
that extends CursorAdapter
, but it says me that I cannot
cast it to an CursorAdapter
.
The method setSuggestionsAdapter(CursorAdapter) in the type SearchView is not applicable for the arguments (InformationAdapter)
InformationAdapter suggestionsAdapter = new InformationAdapter(false, this, suggestions, CursorAdapter.NO_SELECTION);
searchView.setSuggestionsAdapter(suggestionsAdapter);
Upvotes: 1
Views: 540
Reputation: 893
So I have now figured out what the mistake was:
My InformationAdapter
used to extend the CursorAdapter
from the support.v4 Framework.
That did not work. Changing to import android.widget.CursorAdapter;
solved the problem.
Upvotes: 3