title: Action Bar icon not showing in Fragment
body: <p>I want to add a logout icon on the action bar of the fragment, but nothing shows.</p>
  <p>Snippet from my Fragment:</p>
  <pre><code> @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setHasOptionsMenu(true);
          if (getArguments() != null) {
              mParam1 = getArguments().getString(ARG_PARAM1);
              mParam2 = getArguments().getString(ARG_PARAM2);
  
  
          }
  
      }
  
      @Override
      public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
          inflater.inflate(R.menu.actionmenu, menu);
          super.onCreateOptionsMenu(menu, inflater);
      }
  
      @Override
      public boolean onOptionsItemSelected(@NonNull MenuItem item) {
          switch (item.getItemId())
          {
              case R.id.logout_button:
                  startActivity(new Intent(getActivity(), MainActivity.class));
                  getActivity().finish();
          }
          return super.onOptionsItemSelected(item);
      }
  </code></pre>
  <p>My <code>res\menu\actionmenu.xml</code> file:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;menu xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
      &lt;item
          android:id=&quot;@+id/logout_button&quot;
          android:icon=&quot;@drawable/baseline_exit_to_app_black_24dp&quot;
          android:orderInCategory=&quot;100&quot;
          app:showAsAction=&quot;always&quot;
          android:title=&quot;&quot; /&gt;
  &lt;/menu&gt;
  </code></pre>
  <p>I've been trying many things but it does not seem to work. Please help.</p>