tags:

views:

95

answers:

3

hi ,

I am trying to run PhotoStream sample from following link

http://android-developers.blogspot.com/2008/09/android-photostream.html

But when i try to set the wallpaper of an image ( reference class ViewPhotoActivity.java) i am getting following error

android.content.ActivityNotFoundException:

Unable to find explicit activity class {com.android.camera/com.android.camera.CropImage}; have you declared this activity in your AndroidManifest.xml?

and i think the following code is causing the problem

final Intent intent = new Intent("com.android.camera.action.CROP");
intent.setClassName("com.android.camera", "com.android.camera.CropImage");
intent.setData(Uri.fromFile(mFile));
intent.putExtra("outputX", width);
intent.putExtra("outputY", height);
intent.putExtra("aspectX", width);
intent.putExtra("aspectY", height);
intent.putExtra("scale", true);
intent.putExtra("noFaceDetection", true);
intent.putExtra("output", Uri.parse("file:/" + mFile.getAbsolutePath()));
startActivityForResult(intent, REQUEST_CROP_IMAGE);

As i tried to find the solution of this problem but didn't get any.

A: 

I remember reading that this was an undocumented feature and doesn't exist in any API. It is now not accessible in 2.x

If there is no constant in the SDK for the string "com.android.camera.action.CROP" then this is simply not a part of the SDK, and has a chance of breaking in the future

Tim
so what is the ultimate solution ?
Hunt
There appear to be some options here: http://stackoverflow.com/questions/3846338/how-to-crop-an-image-in-android Not tried any of them myself...
Tim
None of one is helpful sorry !!
Hunt
A: 

hey,

i found a way, by following the LogCat while i was croping a contact Image, it called the Intent with following parameters:

cmp=com.android.gallery/com.android.camera.CropImage

so try to replace, the "com.android.camera" with "com.android.gallery" this worked for me: Intent intent = new Intent("com.android.camera.action.CROP"); intent.setClassName("com.android.gallery", "com.android.camera.CropImage");

an3