O
O
orbit0702019-07-11 16:02:08
Android
orbit070, 2019-07-11 16:02:08

In android it is impossible to create an intent to go to the mail client?

You need to open the mail application by clicking on the button, if there are several of them, give the user the opportunity to select the one you need.
Tried everything, googling the whole google.
The maximum that I have achieved is the opening of the Gmail mail client by default (chooser does not work):

Intent emailIntent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_EMAIL);
 emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(Intent.createChooser(emailIntent, ""));

Has anyone ever done this? Is it even possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2019-07-11
@orbit070

Probably not what you were looking for

Intent intentEmail = new Intent(Intent.ACTION_SENDTO);
                Uri uri = Uri.parse("mailto:кому");
                intentEmail.setData(uri);
                intentEmail.putExtra("subject", "тема");
                startActivity(intentEmail);

and you can add text and atach

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question