title: Make Searchview width to full width
body: <p>I want the length of searchview to occupy full width of action bar when clicked but instead it shows the others items as well. This is xml file of the view</p>
  <pre><code>&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;
      &lt;item
          android:id=&quot;@+id/action_settings&quot;
          android:title=&quot;Settings&quot;
          app:showAsAction=&quot;never&quot;/&gt;
      &lt;item
          android:id=&quot;@+id/about&quot;
          android:title=&quot;About&quot;
          app:showAsAction=&quot;never&quot;
          /&gt;
      &lt;item
          android:id=&quot;@+id/edit&quot;
          android:icon=&quot;@drawable/ic_baseline_sort_24&quot;
          app:showAsAction=&quot;always&quot;
          android:title=&quot;Edit&quot;/&gt;
     
      &lt;item android:id=&quot;@+id/search&quot;
          android:title=&quot;search_title&quot;
          android:icon=&quot;@drawable/ic_search&quot;
          app:showAsAction=&quot;always|collapseActionView&quot;
          app:actionViewClass=&quot;androidx.appcompat.widget.SearchView&quot; /&gt;
  
  &lt;/menu&gt;
  </code></pre>
  <p>In the java file I am trying the following</p>
  <pre><code> androidx.appcompat.widget.SearchView searchView = (androidx.appcompat.widget.SearchView) 
                                        item.getActionView();
                         searchView.setMaxWidth(Integer.MAX_VALUE);
  </code></pre>
  <p>It is working as regular search bar with other items shown as well along the bar.</p>