Hello, I am executing action_send but the application stops. I am using android 7 and with other versions it works but with this one it stops.
String email = "[email protected]";
Intent intentMail = new Intent(Intent.ACTION_SEND, Uri.parse("mailto:"+email));
intentMail.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
intentMail.setType("plain/text");
intentMail.putExtra(Intent.EXTRA_SUBJECT, "mails title");
intentMail.putExtra(Intent.EXTRA_TEXT, "Hi there, i love Myform app..");
intentMail.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]","[email protected]"});
startActivity(intentMail);
Surely you have an exception of the type
ActivityNotFoundException
, I suggest you add exception handling when you start the Activity:It is important in this case that you have the Gmail application installed since you are specifying the package:
"com.google.android.gm.ComposeActivityGmail"
I suggest you not specify the Gmail package so that the email can be sent with any client: