Hi all,
I m facing problem in crop image Activity. It give error when I pass
the image uri to the cropimage activity :
02-12 13:02:32.689: ERROR/AndroidRuntime(374): Uncaught handler:
thread main exiting due to uncaught exception
02-12 13:02:32.699: ERROR/AndroidRuntime(374):
java.lang.RuntimeException: Failure delivering result
ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://
media/external/images/media/12 }} to activity {com.abc/
com.abc.CameraActivity}: java.lang.SecurityException: Permission
Denial: starting Intent { act=android.intent.action.EDIT dat=content://
media/external/images/media/12 cmp=com.android.camera/.CropImage (has
extras) } from ProcessRecord{43b72040 374:com.abc/10028} (pid=374,
uid=10028) requires null
02-12 13:02:32.699: ERROR/AndroidRuntime(374): at
android.app.ActivityThread.deliverResults(ActivityThread.java:3314)
02-12 13:02:32.699: ERROR/AndroidRuntime(374): at
android.app.ActivityThread.handleSendResult(ActivityThread.java:3356)
Here is our code:
Intent i = new Intent("com.android.camera.action.CROP");
i.setClassName("com.android.camera",
"com.android.camera.CropImage");
if (data != null && data.getData() != null) {
i.setData(data.getData());
userImageUri = data.getData();
} else {
i.setData(userImageUri);
}
i.putExtra("noFaceDetection", false);
i.putExtra("outputX", CommonConstant.ICON_WIDTH);
i.putExtra("outputY", CommonConstant.ICON_HEIGHT);
i.putExtra("aspectX", CommonConstant.ASPECT_X);
i.putExtra("aspectY", CommonConstant.ASPECT_Y);
i.putExtra("scale", true);
ContentValues values = new ContentValues();
values.put(Media.TITLE, "User_t" + "_Image");
values.put(Media.BUCKET_ID, "User-T");
values.put(Media.BUCKET_DISPLAY_NAME, "image_t");
values.put(Media.IS_PRIVATE, 1);
userThumbnailUri = getContentResolver().insert(
Media.EXTERNAL_CONTENT_URI, values);
i.putExtra(MediaStore.EXTRA_OUTPUT, userThumbnailUri);
try {
startActivityForResult(i, CROP_IMAGE);
} catch (Exception e) {
Log.d("CROP ERROR", "Croping ERROR"+e.getMessage()+e);
}
And URI comes from following activity
intent = new Intent("android.intent.action.GET_CONTENT");
intent.setType("image/*");
startActivityForResult(intent, Get_IMAGE);
data.getData() gives result to crop image activity
Also this things work in android 1.6 but not in 2.1
Please help me out...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en