title: Menu icon is not displaying in action bar
body: <p>I need to inflate custom menu in Fragment.</p>
  
  <p>I have only one menu item.But the icon is not displaying.</p>
  
  <p>Can someone tell what is wrong with my code </p>
  
  <p>My menu.xml</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"  &gt;
  
  &lt;item
      android:id="@+id/search"
      android:icon="@android:drawable/ic_search_category_default"
      app:showAsAction="always"
      android:title="Search"/&gt;&lt;/menu&gt;
  </code></pre>
  
  <p>And I set in onCreateView()</p>
  
  <pre><code>    setHasOptionsMenu(true);
      getActivity().invalidateOptionsMenu();
  </code></pre>
  
  <p>And inflating the menu </p>
  
  <pre><code>@Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      // TODO Auto-generated method stub
  
      inflater = getActivity().getMenuInflater();
  
      inflater.inflate(R.menu.menu, menu);
  
  }
  </code></pre>
  
  <p>Resulting screen attached below. I need to have the search icon instead of the menu overflow icon.</p>
  
  <p><img src="https://i.stack.imgur.com/5rUnc.png" alt="enter image description here"></p>