title: Android - Creating MenuItem with Icon not working
body: <p>I am trying to add a menu item at runtime, with an Icon, but the Icon is not visible.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu) {
  
      super.onCreateOptionsMenu(menu);
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.main, menu);
      createMenu(menu);
      return true;
  }
  
  private void createMenu(Menu menu) {
      // menu.clear();
      MenuItem miRateThisApp = menu.add(0, 0, 0,
              Constants.RATE_THIS_APP_STRING).setIcon(R.drawable.icon);
      miRateThisApp.setOnMenuItemClickListener(new OnMenuItemClickListener() {
  
          @Override
          public boolean onMenuItemClick(MenuItem menuItem) {
  
              AppStoreUtil.goToMarket(getApplicationContext(),
                      Constants.PACKAGE_NAME);
              return true;
          }
      });
  }
  </code></pre>
  
  <p>The text shows up, click listener is working, but the icon is not visible. I have tried the same thing in the XML variant as well but same results.</p>
  
  <p>XML Menu code which I tried earlier:</p>
  
  <pre><code>&lt;menu 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"
  &gt;
  &lt;item
      android:id="@+id/lines"
      android:icon="@drawable/lines"
      android:orderInCategory="1"
      android:title="Lines"
      app:showAsAction="always"&gt;
  
  &lt;/item&gt;
  </code></pre>
  
  <p></p>