电子邮件地址未显示

时间:2013-02-18 06:41:44

标签: android

这是我用来发送电子邮件的代码..但是当我运行它时,我添加的TO地址字符串没有显示在屏幕上..没有任何错误..

Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType(HTTP.PLAIN_TEXT_TYPE);
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"ashwin.innodea@gmail.com"}); // recipients
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Email subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Email message text");
startActivity(emailIntent);

1 个答案:

答案 0 :(得分:0)

试试这个

Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{"ashwin.innodea@gmail.com"});         
email.putExtra(Intent.EXTRA_SUBJECT, "Email subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Email message text");
email.setType("message/rfc822");
startActivity(Intent.createChooser(email, "Choose an Email client :"));