private void sendImage(String fileName,String toUser){
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("jpeg/image");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {toUser});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
"Test Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
"go on read the emails");
File downloadedPic = new File(Environment.getExternalStorageDirectory(),fileName + ".jpg");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(downloadedPic));
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
}
处理发送电子邮件时遇到问题。我的意思是,在我向用户发送电子邮件后,我将完成活动并参考之前的活动。但我不希望这样。我希望在我向用户发送电子邮件后,我将参考下一个活动。我怎么能这样做?请帮忙 !谢谢......
答案 0 :(得分:0)
您可以在活动中覆盖OnActivityResult方法。
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
Intent intentobj=new Intent(currentclassname.this,nextactivity.class)
startActivity(intentobj);
finish();
}
}
}
我认为这有助于你。