I have an actionbar with a search icon. When the search icon is clicked, it expands to a search bar in which the user can type in a search.
The problem is when the
One simpler way, that works even if the SearchView widget is not on the actionbar is the following code:
searchView.setQuery("", false); searchView.setIconified(true);
And that makes the SearchView collapse after a search is made.