I have a button in my app with is supposed to open the mail app of the phone and add the e-mail address that i have saved in a string. I used this :
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{ "mail@mail.com"});
startActivity(email);
but it crashes my app. Please help.
After reading the answer of Lionel Port below i changed the code to :
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{ "mail@mail.com"});
startActivity(Intent.createChooser(email, "Send mail..."));
which is not crashing my app but when the createChooser shows it says that the phone has no app to handle this action even though the phone has an email app and gmail.