title: Change Menu icons when app comes from background (in onResume() method)
body: <p>I tried both <strong>onCreateOptionsMenu(Menu menu)</strong> and <strong>onPrepareOptionsMenu(Menu menu)</strong> methods but when app opens in background I cant change icon visibility.As I think I need to call these methods inside the <strong>onResume()</strong></p>
  
  <p>When app start first time It work as expected.</p>
  
  <pre><code> @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it present.
          getMenuInflater().inflate(R.menu.example_menu, menu);
  
          // show manu items if not ofline mode
          if (Utils.checkNetworkStatus(ExampleActivity.this)) {
              menu.findItem(R.id.edit).setVisible(true);
              menu.findItem(R.id.delete).setVisible(true);
          }else {
              menu.findItem(R.id.edit).setVisible(false);
              menu.findItem(R.id.delete).setVisible(false);
          }
          return true;
      }
  
  
  
  @Override
  public boolean onPrepareOptionsMenu(Menu menu){
  
      if (Utils.checkNetworkStatus(ExampleActivity.this)) {
          menu.findItem(R.id.edit).setVisible(true);
          menu.findItem(R.id.delete).setVisible(true);
      }else {
          menu.findItem(R.id.edit).setVisible(false);
          menu.findItem(R.id.delete).setVisible(false);
      }
      return true;
  } 
  </code></pre>