title: Android SearchView requires two clicks to expand the view
body: <p>Short: When I click on my SearchViewIcon, the SearchView doesn't collapse/expand.</p>
  
  <p>Long:</p>
  
  <p>I"m using a SearchView to filter a RecyclerView in a Fragment that is in my MainActivity.</p>
  
  <p>When I click on the SearchViewIcon (SearchView is iconified by default). I open the tab with the correct Fragment with this code:</p>
  
  <pre><code>searchView.setOnSearchClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  viewPager.setCurrentItem(2, false);
              }
          });
  </code></pre>
  
  <p>The Tab with the correct Fragment is opened like expected. Also the text input is shown, but the SearchView stays iconified. (See picture below.)</p>
  
  <p><a href="http://i.stack.imgur.com/FjnGr.png" rel="noreferrer">Application</a></p>
  
  <p>My SearchView in XML:</p>
  
  <pre><code>&lt;item
      android:id="@+id/action_search"
      android:orderInCategory="1"
      android:icon="@android:drawable/ic_menu_search"
      android:title="@string/menu_item_search_title"
      app:showAsAction="ifRoom"
      app:queryHint="Search name or function"
      app:actionViewClass="android.support.v7.widget.SearchView" /&gt;
  </code></pre>
  
  <p>Things I already tried:</p>
  
  <p>Setting my showAsAction to always or ifRoom|collapseActionView</p>
  
  <pre><code>app:showAsAction="always"
  app:showAsAction="ifRoom|collapseActionView"
  </code></pre>
  
  <p>Request focus on my SearchView:</p>
  
  <pre><code>searchView.requestFocus();
  </code></pre>
  
  <p>Expanding my SearchViewItem:</p>
  
  <pre><code>MenuItem searchViewItem = menu.findItem(R.id.action_search);
  searchViewItem.expandActionView();
  </code></pre>
  
  <p>But non of these things worked...</p>
  
  <p>EDIT
  Like the title says, if I click the SearchViewIcon again, the SearchView does expand.</p>