嗨,我正在开发一个安卓应用程序,我们可以拍照并发送到默认电子邮件中,我用MeadiaStore.ACTION_IMAGE_CAPTURE实现了图像的捕获);
我用location.getLatitude(),location.getLongitude()来定位;
然后,如何将该图像和位置附加到电子邮件中,如email.putExtra(Intent.EXTRA_SUBJECT," subject ");
发布于 2015-03-12 21:33:52
首先,您必须将捕获的图像存储在sdcard中,并使用此代码发送电子邮件。
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("application/image");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{strEmail});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Test Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "From App");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///mnt/sdcard/Myimage.jpeg"));
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
https://stackoverflow.com/questions/29025454
复制