public void setOnCloseListener ( @ NonNull final android . support . v7 . widget . SearchView . OnCloseListener listener ) { if ( searchView != null ) { searchView . setOnCloseListener ( new SearchView . OnCloseListener ( ) { @ Override public boolean onClose ( ) { return listener . onClose ( ) ; } } ) ; } else if ( supportView != null ) { supportView . setOnCloseListener ( listener ) ; } else { throw new IllegalStateException ( ERROR_NO_SEARCHVIEW ) ; } }
Sets a listener to inform when the user closes the SearchView .