I have a SearchView in the ActionBar. When it is selected, the keyboard shows up.
However, when I touch or interact with anything else on the screen, including selecting list items and doing fragment transactions, the keyboard stays up, and the SearchView keeps focus.
I've tried setOnTouchListener() for the fragment, and listening to focus changes and calling the usual keyboard retraction code (link), but nothing works.
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_store_search"
android:icon="@android:drawable/ic_menu_search"
app:showAsAction="always"
app:actionViewClass="com.example.views.CustomSearchView"
android:title="@string/header_search_loc"
android:orderInCategory="1"
android:menuCategory="secondary" />
</menu>