title: Share button is greyed out and disabled
body: <p>I have the following code to open the share Intent but it's disabled and unable to click.</p>
  
  <pre><code>@Override
      public boolean onCreateOptionsMenu(Menu menu) {
          super.onCreateOptionsMenu(menu);
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.share, menu);
  
          return true;
      }
  @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case android.R.id.home: 
                  onBackPressed();
                  break;
              case R.id.action_share:
                  Intent share = new Intent(Intent.ACTION_SEND);
                  share.setType("image/png");
                  File folder = new File(Environment.getExternalStorageDirectory() + "/TESTFOLDER");
                  if (!folder.exists()) {
                      folder.mkdir();
                  }
                  try {
                      if (file.exists()) {
                          share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
                          startActivityForResult(Intent.createChooser(share, "Share Chart"), 1);
                      }
                      else {
                          //displayToast("Please save your image before sharing.");
                      }
                  }
                  catch (Exception e) {
                      e.printStackTrace();
                  }
                  return true;
              default:
                  return super.onOptionsItemSelected(item);
          }
          return true;
      }
  </code></pre>
  
  <p>share xml:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;
      &lt;item android:id="@+id/action_share"
          android:showAsAction="always"
          android:title="Share"
          android:actionProviderClass="android.widget.ShareActionProvider" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>The share icon is disabled in my action bar:</p>
  
  <p><img src="https://i.stack.imgur.com/dtZqX.png" alt="enter image description here"></p>