我与Gmail应用程序共享图像问题。 这是我的代码。与Gmail应用程序共享图像不起作用
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.mail_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, getString(R.string.mail_body));
emailIntent.putExtra(Intent.EXTRA_TITLE, getString(R.string.facebook_share_text));
//Download the image first
String location=downloadImage(true);
File root=android.os.Environment.getExternalStorageDirectory();
Log.e("send from where:","file:///"+root.getAbsolutePath()+"/"+location);
//Add attachment
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///"+root.getAbsolutePath()+"/"+location));
emailIntent.setType("image/jpeg");
startActivity(Intent.createChooser(emailIntent, getString(R.string.share_by)));
默认的电子邮件应用程序是伟大的工作,分享至Facebook是伟大的工作,Gmail的应用接缝工作,但附件是不发送,虽然显示为附件。
这里是屏幕截图。
所以,请帮助。