How to send Email with attachment using only email apps?
<p><strong>There are two requirements:</strong></p>

<ul>
<li>Email with attachment</li>
<li>In the <code>Intent</code> chooser, there should be only Email apps.</li>
</ul>

<p><strong>What I have known/done:</strong></p>

<ul>
<li><p><code>Intent.ACTION_SENDTO</code> with <code>intent.setData(Uri.parse("mailto:"))</code> can make sure that there are only Email apps in <code>Intent</code> chooser but it will not bring attachment(For some apps like Gmail it will, but there are also many apps that will ignore attachment).</p></li>
<li><p><code>Intent.ACTION_SEND</code> can send Email with attachment. However, in <code>Intent</code> chooser, there will be apps that are actually not Email apps but can response to <code>Intent.ACTION_SEND</code>. Using <code>intent.setType("message/rfc822")</code> can reduce number of those apps but not all.</p></li>
<li><p>References this answer: <a href="https://stackoverflow.com/a/8550043/3952691">https://stackoverflow.com/a/8550043/3952691</a> and nearly succeed in my goals. My code is as below:</p>

<pre><code>private static void sendFeedbackWithAttachment(Context context, String subject) {
    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setData(Uri.parse("mailto:"));

    PackageManager packageManager = context.getPackageManager();
    List&lt;ResolveInfo&gt; resolveInfos = packageManager.queryIntentActivities(intent, 0);
    if (resolveInfos.isEmpty()) {
        Toast.makeText(context, context.getString(R.string.error_activity_not_found),
                Toast.LENGTH_SHORT).show();
    } else {
        // ACTION_SEND may be replied by some apps that are not email apps. However,
        // ACTION_SENDTO doesn't allow us to choose attachment. As a result, we use
        // an ACTION_SENDTO intent with email data to filter email apps and then send
        // email with attachment by ACTION_SEND.
        List&lt;LabeledIntent&gt; intents = new ArrayList&lt;&gt;();
        Uri uri = getLatestLogUri();
        for (ResolveInfo info : resolveInfos) {
            Intent i = new Intent(Intent.ACTION_SEND);
            i.setPackage(info.activityInfo.packageName);
            i.setClassName(info.activityInfo.packageName, info.activityInfo.name);
            i.putExtra(Intent.EXTRA_EMAIL, new String[] { Def.Meta.FEEDBACK_EMAIL });
            i.putExtra(Intent.EXTRA_SUBJECT, subject);
            i.putExtra(Intent.EXTRA_STREAM, uri);
            intents.add(new LabeledIntent(i, info.activityInfo.packageName,
                    info.loadLabel(context.getPackageManager()), info.icon));
        }
        Intent chooser = Intent.createChooser(intents.remove(0),
                context.getString(R.string.send_feedback_to_developer));
        chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS,
                intents.toArray(new LabeledIntent[intents.size()]));
        context.startActivity(chooser);
    }
}
</code></pre>

<p>However, on some devices(For example, Xiaomi 2S with MIUI V5, I don't know if this can be influenced by a third-party rom), the result is an empty <code>Intent</code> chooser. And it seems that above Android 6.0, <code>Intent.EXTRA_INITIAL_INTENTS</code> has some bugs(<a href="https://stackoverflow.com/questions/35842612/custom-intent-chooser-why-on-android-6-does-it-show-empty-cells">Custom intent-chooser - why on Android 6 does it show empty cells?</a>, and another one: <a href="https://code.google.com/p/android/issues/detail?id=202693" rel="nofollow noreferrer">https://code.google.com/p/android/issues/detail?id=202693</a>).</p></li>
</ul>

<p>As a result, I don't know how to achieve my goals. Please help me, thank you in advance.</p>