title: menu inflating calls multiple times at fragment's onCreateOptionsMenu
body: <p>I use Fragments and when I switch to nested Fragment, which implements <code>public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)</code> my menu inflates quantity of times when I get to that nested Fragment. How can I avoid this? I also implement constructor of Fragment with methods:</p>
  
  <pre><code>setRetainInstance(true);
  setHasOptionsMenu(true);
  </code></pre>
  
  <p>When I tried to implement siple solution as: </p>
  
  <pre><code> @Override
   public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
       // TODO Add your menu entries here
     if(!isInflated)
           {
           inflater.inflate(R.menu.contacts_archive_menu, menu);
           isInflated = true;
           }
           super.onCreateOptionsMenu(menu, inflater);
  
   }
  </code></pre>
  
  <p>but my menu wasn't inflate after the screen rotation.</p>