I currently have a SearchView in the action bar of my app. When I click the search icon, the SearchView expands and the keyboard pops up as expecte
SearchView
Based on @MarcinOrlowski answer, also you can use:
@Override public void onBackPressed() { if (!searchView.isIconified()) { searchView.setIconified(true); } else { super.onBackPressed(); } }