I have the same question which I found here which I will re-iterate because the solution is not 100% exactly what I need:
I currently have a SearchVie
An interesting answer!
@Override
public void onBackPressed() {
if (!searchView.isIconified()) {
searchView.setIconified(true);
searchView.setIconified(true);
} else {
super.onBackPressed();
}
}
Instead of hide soft keyboard manually, try clearFocus()
method
mSearchView.setIconified(true);
mSearchView.clearFocus();