0

我有下面的控制器,它从我的 Android 应用程序中创建了一个“联系我们”类型的对话框。除了某些手机在选择器对话框中包含电子邮件帐户以外的其他内容外,一切似乎都运行良好。我已经看到蓝牙出现了,有时即使手机上没有设置电子邮件帐户,也会出现默认的 Android 电子邮件帐户。我的 gmail 帐户已设置,并且应该显示。关于我哪里出错的任何想法?

public class EmailController implements onClickListener {

    private EmailActivity emailActivity;

    public EmailController(EmailActivity eActivity){
        super();
        emailActivity = eActivity;

    }

    @Override
    public void onClick(View v){
        Intent intent = new Intent();

        switch (v.getId()) {
            case R.id.helpinfo_submit_support_reqst_btn:

                final Intent emailIntent = new Intent(
                    Intent.ACTION_SEND);
                emailIntent.setType("plain/text");
                emailIntent.putExtra(Intent.EXTRA_EMAIL,
                    new String[] { mResources
                            .getString(R.string.emailId) });
                emailIntent.putExtra(Intent.EXTRA_SUBJECT,
                    mResources.getString(R.string.emailSubject));
                emailIntent.putExtra(Intent.EXTRA_TEXT, "email body....");
                emailActivity.startActivity(Intent.createChooser(emailIntent,
                                   emailActivity.getResources().getString(R.string.info_screen_send_mail)));

                emailBody = null;  

            break;

        }

    }

}
4

1 回答 1

0

要发送邮件,请将类型设置为:

...
emailIntent.setType("message/rfc822");

参考:

于 2012-07-09T03:49:22.563 回答