title: How to hide the option menu when using getSupportFragment
body: <p>Good Morning Guys,</p>
  
  <p>i am trying to hide the option menu on some fragment.For the example i just want the option menu show on Promotion page</p>
  
  <p><a href="https://i.stack.imgur.com/AAfKF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AAfKF.png" alt="enter image description here"></a></p>
  
  <p>i add the code in the promotion.java</p>
  
  <pre><code>public void onCreateOptionsMenu(Menu menu,MenuInflater inflater) {
      inflater.inflate(R.menu.toolbar_menu, menu);
  
      super.onCreateOptionsMenu(menu,inflater);
  }
  </code></pre>
  
  <p>and then i want to hide on other fragment.</p>
  
  <p>when i launching the app and the first fragment is like <a href="https://i.stack.imgur.com/lxRh8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lxRh8.png" alt="enter image description here"></a></p>
  
  <p>but when i click to the promotion page and click back to the menu page and the action bar will be like this</p>
  
  <p><a href="https://i.stack.imgur.com/r39bo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r39bo.png" alt="enter image description here"></a></p>
  
  <p>i am using getSupportFragment to call the menu item, and this problem just only happen on the fragment using the getSupportFragment call out.</p>
  
  <pre><code>case R.id.menu:
                   getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MenuFragment()).addToBackStack(null).commit();
  </code></pre>