Android 裁剪图像时应用程序挂起
我有下面的裁剪方法。当我调用Android 裁剪图像时应用程序挂起,android,Android,我有下面的裁剪方法。当我调用cropinent.putExtra(MediaStore.EXTRA_输出,uri)时我的屏幕挂起在“保存图像”处。如果我不调用它,则裁剪后的图像不会写入文件 private void crop() { try { Intent cropIntent = new Intent("com.android.camera.action.CROP"); cropIntent.setDataAndType(mImageCaptureUri, "image/*
cropinent.putExtra(MediaStore.EXTRA_输出,uri)时代码>我的屏幕挂起在“保存图像”处。如果我不调用它,则裁剪后的图像不会写入文件
private void crop() {
try {
Intent cropIntent = new Intent("com.android.camera.action.CROP");
cropIntent.setDataAndType(mImageCaptureUri, "image/*");
cropIntent.putExtra("crop", "true");
cropIntent.putExtra("aspectX", 4);
cropIntent.putExtra("aspectY", 3);
cropIntent.putExtra("outputX", 500);
cropIntent.putExtra("outputY", 300);
File f = new File(Environment.getExternalStorageDirectory(),
"/temporary_holder.jpg");
try {
f.createNewFile();
} catch (IOException ex) {
Log.e("io", ex.getMessage());
}
uri = Uri.fromFile(f);
cropIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
startActivityForResult(cropIntent, PIC_CROP);
} // respond to users whose devices do not support the crop action
catch (ActivityNotFoundException anfe) {
// display an error message
String errorMessage = "Your device doesn't support the crop action!";
Toast toast = Toast
.makeText(this, errorMessage, Toast.LENGTH_SHORT);
toast.show();
}
}
我也有同样的问题,它与:
cropIntent.putExtra(“输出”,500);
.. 非常严重,唯一的修复方法就是取出电池
但是如果我
cropIntent.putExtra(“输出”,200);它很好用
(设备HTC Sensation Z710e Android 4.0.3(API 15))编辑你的问题标题dude的可能副本。。。同时也要检查一下,并张贴日志,车祸的原因是什么?千万不要车祸。。只是停留在保存图像