【发布时间】:2014-01-14 07:01:00
【问题描述】:
我想在我的应用程序中包含反馈..所以我需要显示一个弹出窗口来发送邮件并且..我需要输入我的邮件 ID 和反馈,当我点击弹出窗口中的发送按钮时,邮件必须发送到预定义的邮件ID..怎么可能???
【问题讨论】:
我想在我的应用程序中包含反馈..所以我需要显示一个弹出窗口来发送邮件并且..我需要输入我的邮件 ID 和反馈,当我点击弹出窗口中的发送按钮时,邮件必须发送到预定义的邮件ID..怎么可能???
【问题讨论】:
这就是你在 android 中实现反馈的方式:
Intent feedbackEmail = new Intent(Intent.ACTION_SEND);
feedbackEmail.setType("text/email");
feedbackEmail.putExtra(Intent.EXTRA_EMAIL, new String[] {"yourfeedbackreceiveemailid"});
feedbackEmail.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
startActivity(Intent.createChooser(feedbackEmail, "Send Feedback:"));
【讨论】:
【讨论】:
此代码确实有效。将此代码放在按钮单击(反馈)上
private void sendEmail() {
File photo = new File("sdcard/Video Tell Images/" + ViewVideo.saved_image_name);
Uri imageuri = Uri.fromFile(photo);
Intent send_report = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "youremail@example.com", null));
send_report.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");
send_report.putExtra(Intent.EXTRA_TEXT, "View my image");
send_report.setType("text/plain");
startActivity(send_report);
}
【讨论】:
以下内容对我来说很好。
public static void writeReviewMail(Context context) {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "youremail@example.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.yoursubject));
context.startActivity(Intent.createChooser(emailIntent, context.getString(R.string.contact_us)));
}
它让用户选择他的电子邮件应用程序并插入收件人以及电子邮件的主题。 这可能在模拟器中不起作用,但它适用于我迄今为止测试过的所有真实设备。 [2.1 - 4.4]
【讨论】: