我想在我的应用程序中包含反馈..所以我需要显示一个弹出窗口来发送邮件和..我需要输入我的邮件ID和反馈,当我点击弹出窗口中的发送按钮时,邮件必须发送到预定义的邮件ID ..如何有可能???
答案 0 :(得分:3)
这是你在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:"));
答案 1 :(得分:1)
以下对我来说很好。
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]
答案 2 :(得分:1)
答案 3 :(得分:0)
此代码实际上有效。将此代码放在按钮单击(反馈)
上 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);
}