Delphian
Delphian

Reputation: 1760

How to show the search results in SearchView

I use toolbar searchview. I catch input result using code:

SearchView.OnQueryTextListener queryTextListener = new SearchView.OnQueryTextListener() {
        public boolean onQueryTextChange(String newText) {

            return true;
        }

When I have the result I am looking for the similar strings in my excel file. Then I return ArrayList (search results). And now I need to show the results in SearchView. How can I do it?

Upvotes: 0

Views: 1650

Answers (1)

Jacob
Jacob

Reputation: 523

You need to use a CursorAdapter associated with your searchview.

Searchview.setSuggestionAdapter

Helpful link about the usage of a cursor from an array (Create a cursor from hardcoded array instead of DB).

Upvotes: 1

Related Questions