我正在开发一个我正在进行图像裁剪的 Android 应用程序。我使用了以下适用于 Gallery 和 Camera 的代码行。我已经在具有 API 4.2 的 LG-Nexus 和 MicroMax Mobile 上对其进行了测试,它们都可以正常工作,但不适用于三星 Nexus-S。当我按下 OK 按钮时,在裁剪活动中没有任何反应。它也没有给出任何错误。
public void cropCapturedImage(Uri picUri){
//call the standard crop action intent
Intent cropIntent = new Intent("com.android.camera.action.CROP");
//indicate image type and Uri of image
cropIntent.setDataAndType(picUri, "image/*");
//set crop properties
cropIntent.putExtra("crop", "true");
//indicate aspect of desired crop
cropIntent.putExtra("aspectX", 1);
cropIntent.putExtra("aspectY", 1);
//indicate output X and Y
cropIntent.putExtra("outputX", 512);
cropIntent.putExtra("outputY", 512);
//retrieve data on return
cropIntent.putExtra("return-data", true);
//start the activity - we handle returning in onActivityResult
startActivityForResult(cropIntent, 2);
}