android 发送邮件意图
程序员文章站
2022-05-28 15:01:10
...
try{
// 设置需要发送的邮箱
Uri uri = Uri.parse("mailto:" + "[email protected]");
Intent intent = new Intent(Intent.ACTION_SENDTO,uri);
// 设置邮件标题
intent.putExtra(Intent.EXTRA_SUBJECT,"纸飞机使用反馈与建议"));
// 设置邮件内容
intent.putExtra(Intent.EXTRA_TEXT,
activity.getString(R.string.device_model) + Build.MODEL + "\n"
+ activity.getString(R.string.sdk_version) + Build.VERSION.RELEASE + "\n"
+ activity.getString(R.string.version));
activity.startActivity(intent);
}catch (android.content.ActivityNotFoundException ex){
view.showFeedbackError();
}