Intent intent = new Intent("com.android.camera.action.CROP");
File path = this.getExternalFilesDir("tmp");
File file = new File(path, "tmp_" + String.valueOf(System.currentTimeMillis()) + ".jpg");
Uri tmpUri = Uri.fromFile(file);
intent.setData(selectedImage);
intent.putExtra(MediaStore.EXTRA_OUTPUT, tmpUri);
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
intent.putExtra("crop", "true");
intent.putExtra("scale", "true");
intent.putExtra("outputX", 100);
intent.putExtra("outputY", 100);
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("return-data", false);
startActivityForResult(intent, REQUEST_CROP);
I am using this code to crop image. It works perfectly on android 2.x. But on 3.1(motorola xoom) and 3.2(acer iconia) the application freeze after I select crop area and tap "Save" (onActivityResult is not even called). There is a real Uri to real image in selectedImage variable, so the problem is not here.
On the 3.1 and 3.2 android emulators the application works perfectly too. Does anyone know what s the problem?