title: How to show SearchView from Toolbar only in one Fragment?
body: <p>In my app i have one activity with two fragment, the app has a toolbar with search action, that search action must be visible only in the second fragment.</p>
  <p>So how could i hide the search button and show it only when i'm in fragment2?</p>
  <p>My menu.xml looks like this:</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;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      tools:context=&quot;it.gabtamagnini.visualstock.MainActivity&quot;&gt;
      &lt;item
          android:id=&quot;@+id/action_settings&quot;
          android:orderInCategory=&quot;100&quot;
          android:title=&quot;@string/action_settings&quot;
          app:showAsAction=&quot;never&quot; /&gt;
      &lt;item
          android:id=&quot;@+id/app_bar_search&quot;
          android:icon=&quot;@drawable/ic_search_black_24dp&quot;
          android:title=&quot;@string/cerca&quot;
          app:showAsAction=&quot;ifRoom|withText&quot;
          app:actionViewClass=&quot;android.widget.SearchView&quot; /&gt;
  &lt;/menu&gt;
  </code></pre>
  <p>I'm using kotlin</p>