我正在发送一封电子邮件,但是当用户从电子邮件撰写器返回时,我需要转到其他活动,如何完成此操作?
这是我的代码,//发送邮件
String prestartTypeString = prestartType;
String to = "juanman234@gmail.com";
String subject = "Pre-Start - "+prestartTypeString;
String message = fullName+" has sent you a Pre-Start checklist for equipment "
+registrationNumber+".\n" + "Please find PDF report attached.
\n\nNeed help viewing this report\nEmail us anytime at\nhello@tiks.com.au";
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{ to});
email.putExtra(Intent.EXTRA_SUBJECT, subject);
email.putExtra(Intent.EXTRA_TEXT, message);
//attachment
Uri uri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
"generato.pdf"));
email.putExtra(Intent.EXTRA_STREAM, uri);
//need this to prompts email client only
email.setType("message/rfc822");
startActivity(Intent.createChooser(email, "Choose an Email client :"));
setResult(RESULT_OK, email);
我检查过
startActivityForResult();
但不清楚这是否是这样做的方法,并且没有让它工作
那么当用户从电子邮件意图返回时如何触发功能呢?
谢谢