title: Unable to set menu for fragment
body: <pre><code>Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setHasOptionsMenu(true);
      Log.i("frag", "onCreate");
  }
  
  
   @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      setHasOptionsMenu(true);
      final View view = inflater.inflate(R.layout.fragment_initiate_chat, container, false);
  
      bindViews(view);
  
      setUpClickListener();
  
      setUpCategories(view);
  
      return view;
  }
  
   @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      //menu.clear();
      inflater.inflate(R.menu.menu_inititate_chat, menu);
      Log.i("frag", "onCreateOptionsMenu");
      //super.onCreateOptionsMenu(menu, inflater);
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      Log.i("frag", "onOptionsItemSelected");
      final int itemId = item.getItemId();
      switch (itemId) {
          case R.id.send:
              sendIssue();
              break;
  
      }
      return super.onOptionsItemSelected(item);
  }
  </code></pre>
  
  <p>I am unable to set a menu for my fragment.I have used the  setHasOptionsMenu(true); but it still doesn't make a difference.</p>
  
  <p>My fragment xml layout.</p>
  
  <pre><code>&lt;LinearLayout 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"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/bgGrey"
  android:orientation="vertical"&gt;
  
  &lt;android.support.v7.widget.Toolbar
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:background="@color/colorPrimary"
      android:minHeight="?attr/actionBarSize"
      app:navigationIcon="@drawable/ic_close_black_24dp"
      app:popupTheme="@style/Theme.AppCompat.NoActionBar"
      app:titleTextColor="@color/toolbarTextColor" /&gt;
  
  &lt;Spinner
      android:id="@+id/categories"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" /&gt;
  
  
      &lt;/LinearLayout&gt;`
  </code></pre>
  
  <p>The menu item menu_inititate_chat.xml</p>
  
  <pre><code>    `&lt;?xml version="1.0" encoding="utf-8"?&gt;
       &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
     &lt;item
      android:id="@+id/send"
      android:orderInCategory="100"
      android:title="@string/send"
      android:icon="@drawable/send"
      app:showAsAction="always" /&gt;
      &lt;/menu&gt;`
  </code></pre>
  
  <p>The activity which contains this fragment does not included a toolbar of its own.</p>