0

I am trying to share text and attachment using ACTION_SEND.

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"email"});
    intent.putExtra(Intent.EXTRA_SUBJECT, "subject");
    intent.putExtra(Intent.EXTRA_TEXT, "body");

    Uri uri = Uri.fromFile(file);
    intent.putExtra(Intent.EXTRA_STREAM, uri);

    startActivity(Intent.createChooser(intent, "Send..."));

However, in the list appear applications like Hangouts which do not accept attachments.

Can I filter out application which do not accept attachments? Is there a tag or another indicator which can tell me if application accepts attachments or not?

sandalone
  • 41,141
  • 63
  • 222
  • 338

1 Answers1

1
  intent.setType("message/rfc822");

Use this.

deepak825
  • 432
  • 2
  • 8