Code example for SearchManager

Methods: getSearchableInfo

        // Get the SearchView and set the searchable configuration 
        SearchManager searchManager = (SearchManager) activity.getSystemService(Context.SEARCH_SERVICE);
        mSearchView = (SearchView) searchItem.getActionView();
        assert mSearchView != null;
        // Assumes current activity is the searchable activity 
        mSearchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default
    public boolean onOptionsItemSelected(MenuItem item) {
        if (D) Log.d(LOG_TAG, "onOptionsItemSelected");
        int id = item.getItemId();
        // Клик по Refresh работает с ImageView.onClick 
        if (id == {
            if (D) Log.d(LOG_TAG, "Search btn!");
            return false; 
        if (D) Log.d(LOG_TAG, "super.onOptionsItemSelected");
        return super.onOptionsItemSelected(item);