@Override |
public void onClick(View v) { |
// TODO Auto-generated method stub |
/* 透过Intent来发送邮件 */ |
Intent mEmailIntent = new Intent( |
android.content.Intent.ACTION_SEND); |
/* 设定邮件格式为plain/text */ |
mEmailIntent.setType( "plain/text" ); |
/* 取得EditText01,02,03,04的值作为收件人地址,附件,主题,内容 */ |
strEmailReciver = new String[] { mEditText01.getText() |
.toString() }; |
strEmailCc = new String[] { mEditText02.getText().toString() }; |
strEmailSubject = mEditText03.getText().toString(); |
strEmailBody = mEditText04.getText().toString(); |
/* 将取得的字符串放入mEmailIntent中 */ |
mEmailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, |
strEmailReciver); |
mEmailIntent.putExtra(android.content.Intent.EXTRA_CC, |
strEmailCc); |
mEmailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, |
strEmailSubject); |
mEmailIntent.putExtra(android.content.Intent.EXTRA_TEXT, |
strEmailBody); |
/* 开启Gmail 并将相关参数传入 */ |
startActivity(Intent.createChooser(mEmailIntent, getResources() |
.getString(R.string.str_message))); |
} |
初级程序员
by: 小蘑菇 发表于:2013-05-05 23:09:27 顶(0) | 踩(0) 回复
收藏,备用
回复评论