3

Hi Friends,

I want to use the Crop Activity but it will Crash as

to activity {com.CropActivity/com.CropActivity.CropActivity}: android.content.ActivityNotFoundException:

Its Code is Properly Working in Andorid 1.6 but its Crash in 2.1 or 2.2. please give me solution Thanks in advance

This is my Code for Start the Crop Activity.

 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);
Shreyash Mahajan
  • 22,310
  • 34
  • 106
  • 187
Hardik Gajjar
  • 4,978
  • 8
  • 30
  • 50
  • what is `com.CropActivity.CropActivity` and have you declared it in your manifest? – Matt K Mar 14 '12 at 13:25
  • Yes the com.CropActivity.CropActivity is just my File name.. – Hardik Gajjar Mar 14 '12 at 13:34
  • in your intent your trying to call the android crop image activity. That's not part of the API so the string names are different. See my post for possible solutions/alternatives. You should not use that activity for your application as it is different on different phones. – BoredAndroidDeveloper Mar 14 '12 at 14:00
  • @HardikGajjar : at which line it crash ? put error log and also the code of startActivityForResult(...) – Shreyash Mahajan Mar 16 '12 at 05:30

1 Answers1

1

If this is the CropActivity that exists on android by default then it is not officially part of the API so the intent string has probably changed.

See these links for possible solutions/alternatives

Community
  • 1
  • 1
BoredAndroidDeveloper
  • 1,241
  • 1
  • 9
  • 25