当我通过 emailIntent 添加图像 Android 时,Gmail 应用崩溃了
Gmail app is crashing when i attach a image through emailIntent Android
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Image Attachment");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(resize_file));
startActivity(Intent.createChooser(emailIntent, "Send email..."));
private void compress(Bitmap bitmap) {
Bitmap out = Bitmap.createScaledBitmap(bitmap, 1024, 800, false);
try {
resize_file = createTemporaryFile("resize", ".jpg");
} catch (Exception e1) {
e1.printStackTrace();
}
FileOutputStream fOut;
try {
fOut = new FileOutputStream(resize_file);
out.compress(Bitmap.CompressFormat.JPEG, 50, fOut);
fOut.flush();
fOut.close();
bitmap.recycle();
out.recycle();
} catch (Exception e) {
}
}
Gmail 跟踪:
Gmail 应用程序打开时带有附件,但是当我点击发送按钮时,我收到一条错误消息 'Gmail app is not responding'。提前致谢。
我不知道什么是正确的问题。但清除 Gmail 应用程序数据解决了我的问题。无论如何感谢 A Honey Bustard 的回复..
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Image Attachment");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(resize_file));
startActivity(Intent.createChooser(emailIntent, "Send email..."));
private void compress(Bitmap bitmap) {
Bitmap out = Bitmap.createScaledBitmap(bitmap, 1024, 800, false);
try {
resize_file = createTemporaryFile("resize", ".jpg");
} catch (Exception e1) {
e1.printStackTrace();
}
FileOutputStream fOut;
try {
fOut = new FileOutputStream(resize_file);
out.compress(Bitmap.CompressFormat.JPEG, 50, fOut);
fOut.flush();
fOut.close();
bitmap.recycle();
out.recycle();
} catch (Exception e) {
}
}
Gmail 跟踪:
Gmail 应用程序打开时带有附件,但是当我点击发送按钮时,我收到一条错误消息 'Gmail app is not responding'。提前致谢。
我不知道什么是正确的问题。但清除 Gmail 应用程序数据解决了我的问题。无论如何感谢 A Honey Bustard 的回复..