bvv
bvv

Reputation: 1903

How to start an email app via intent?

I try this:

Intent intentEmail = new Intent(Intent.ACTION_SEND);
intentEmail.setType("message/rfc822");
intentEmail.putExtra(Intent.EXTRA_EMAIL  , new String[]{cif.email});
context.startActivity(intentEmail);

But shows selection dialog with unnecessary applications (google drive and other). How i can fix it?

Upvotes: 0

Views: 49

Answers (1)

DejanRistic
DejanRistic

Reputation: 2039

You can specify the data as "mailto:", if you want it to send to a specific email you can specify by saying "mailto:[email protected]"

Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:" + some email)); // or just "mailto:"
startActivity(intent);

Good Luck!

Upvotes: 2

Related Questions