title: SearchView not appearing as action view in android lollipop
body: <p>I've been converting my app to the new material design standard and have been replacing action bar sherlock with actionbarcompat. Though I have come across a strange issue regarding the searchview widget in my application. The application is crashing because whenever I try to get the action view, the widget that is returned is null. This was determined after extensive debugging. When I commented out the code that was causign the crash, the search appears as an overflow item rather than as an action item even after being explicitly set to show always.</p>
  
  <p>Here is the menu xml</p>
  
  
  
  <p></p>
  
  <pre><code>&lt;item
      android:id="@+id/search"
      app:actionViewClass="android.widget.SearchView"
      android:icon="@android:drawable/ic_menu_search"
      app:showAsAction="always|collapseActionView"
      android:showAsAction="always|collapseActionView"
      android:title="@string/title" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>And heres is the section of code which inflated the menu and attempts to get the action item. The line that is commented out is the one that is throwing and error and all the lines after that are 
  dependant on that object.</p>
  
  <pre><code>public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      inflater.inflate(R.menu.homescreen, menu);
      MenuItem item=menu.findItem(R.id.search);
  //SearchView sv = (SearchView) MenuItemCompat.getActionView(item);
  //SearchManager manager = (SearchManager)getActivity().getSystemService(Context.SEARCH_SERVICE);
  //sv.setSearchableInfo(manager.getSearchableInfo( newComponentName(getActivity().getApplicationContext(), SearchActivity.class)));
          sv.setOnQueryTextListener(this);
          sv.setIconifiedByDefault(false);
  
  }
  </code></pre>
  
  <p>Thanks for any help!</p>