嗨,我正在使用内置的电子邮件发送功能。但是当我尝试代码时。
void sendEmailMessage(String emailId)
{
Log.i(TAG, "emailId = "+emailId);
Intent intentEmail = new Intent(Intent.ACTION_SEND);
intentEmail.setType("text/plain");
String[] recipients = new String[]{emailId};
intentEmail.putExtra(Intent.EXTRA_EMAIL,recipients);
intentEmail.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
intentEmail.putExtra(Intent.EXTRA_TEXT, "body of email");
try
{
startActivity(Intent.createChooser(intentEmail, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex)
{
Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
ex.printStackTrace();
}
}
我在电子邮件屏幕上的收件人 EditText 中没有看到收件人电子邮件地址。我没有得到我做错的事情,请帮忙。