Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message/rfc822 as intent type not received #593

Closed
PaulWoitaschek opened this issue Mar 28, 2015 · 1 comment
Closed

message/rfc822 as intent type not received #593

PaulWoitaschek opened this issue Mar 28, 2015 · 1 comment

Comments

@PaulWoitaschek
Copy link

When I send an intent from my app like this:

Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
    "mailto", "woitaschek@gmail.com", null));
emailIntent.setType("message/rfc822");
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Hello k9 dog");
Intent startClientIntent = Intent.createChooser(emailIntent, "Sending Mail...");
startClientIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
    getApplicationContext().startActivity(startClientIntent);
} catch (ActivityNotFoundException ignored) {
}

K9 Mail wont receive that intent unless I remove the type

//emailIntent.setType("message/rfc822");
@cketti
Copy link
Member

cketti commented Mar 28, 2015

Don't just copy code snippets off the internet. Check the documentation of ACTION_SENDTO. There you can see that EXTRAs aren't officially supported with ACTION_SENDTO. Also, you don't have to specify a type.

You can use the MailTo class to create the necessary mailto: URI.

@cketti cketti closed this as completed Mar 28, 2015
@cketti cketti added the invalid label Mar 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants