我正在尝试打开我的可绘制图像以裁剪意图。
但我得到这个错误:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.camera.action.CROP dat=android.resource:/com.example.jain/drawable/b typ=image/* (has extras) }
代码:
final Uri selectedImage = Uri.parse("android.resource:/com.example.jain/drawable/b");
final Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(selectedImage, "image/*");
intent.putExtra("crop", "true");
intent.putExtra("scale", true);
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("outputX", width);
intent.putExtra("outputY", width);
intent.putExtra(MediaStore.EXTRA_OUTPUT, FileUtils.getTempUri());
intent.putExtra("outputFormat", Bitmap.CompressFormat.PNG.toString());
startActivityForResult(intent, 1);