嗨朋友们,
我想使用Crop Activity但它会崩溃为
to activity {com.CropActivity / com.CropActivity.CropActivity}:android.content.ActivityNotFoundException:
它的代码在Andorid 1.6中正常工作,但它在2.1或2.2中崩溃.
请给我解决方案
提前致谢
这是我开始裁剪活动的代码.
Intent i = new Intent("com.android.camera.action.CROP"); i.setClassName("com.android.camera","com.android.camera.CropImage"); i.setData(data.getData()); image.setimageURI(data.getData()); Log.d("Camera","path: " + data.getData().getPath()); i.putExtra("noFaceDetection",false); i.putExtra("outputX",iconWidth); i.putExtra("outputY",iconHeight); i.putExtra("aspectX",iconWidth); i.putExtra("aspectY",iconHeight); i.putExtra("scale",true); i.putExtra("output",Uri.parse(iconUri)); i.putExtra("return-data",true); startActivityForResult(i,CROP_IMAGE);
解决方法
如果这是默认情况下android上存在的CropActivity,则它是
not officially part of the API,因此意图字符串可能已更改.
> unable to find com.android.camera.CropImage activity in android
> How to crop an image in android?