Intent.EXTRA_EMAIL not populating the To field

前端 未结 6 1655
有刺的猬
有刺的猬 2021-02-03 16:35

I am trying to use an intent to send an email from my application but the To field of the email will not populate. If I add code to fill in the subject or text, they work fine.

6条回答
  •  死守一世寂寞
    2021-02-03 17:17

    private void callSendMeMail() {
        Intent Email = new Intent(Intent.ACTION_SEND);
        Email.setType("text/email");
        Email.putExtra(Intent.EXTRA_EMAIL, new String[] { "me@gmail.com" });
        Email.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
        startActivity(Intent.createChooser(Email, "Send mail to Developer:"));
    }
    

提交回复
热议问题