title: Send Email with Intent: Allow only email programs that support attachments
body: <p>I'm trying to limit the program list presented to the user when sending an email with Intents in Android to ones that support <em>sending an email with an attachment</em>. </p>
  
  <p>This is setup as follows; (sending an email with a pic attached)</p>
  
  <pre><code>   Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
     emailIntent.setType("message/rfc822");
     emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "" });
     emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, EMAIL_SUBJECT);
     emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(EMAIL_BODY));
  
     setupImageForSharing();
     Uri uri = Uri.fromFile(casted_image);
     emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
  
     try {
        startActivity(Intent.createChooser(emailIntent, "Send Email."));
        if (mListner != null) {
           mListner.shared(true);
           mListner = null;
        }
     } catch (Exception ex) {
  
     }
  </code></pre>
  
  <p>This unfortunately still throws up programs such as Google Drive and ES File Explorer which do not support what is expected. How could we limit this list to programs that support sending an email with an attachment?</p>
  
  <p>There are similar questions I've found listed below, but they do not quite answer my issue of filtering out programs which allow attachments:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3312438/how-to-open-email-program-via-intents-but-only-an-email-program">How to open Email program via Intents (but only an Email program)</a></li>
  <li><a href="https://stackoverflow.com/questions/8701634/send-email-intent">Send Email Intent</a></li>
  </ul>