AsadYarKhan
AsadYarKhan

Reputation: 688

Unable to start crop activity (using github.com/lvillani/android-cropimage ) Library

I use the Library: https://github.com/lvillani/android-cropimage for adding crop activity in my project.I import this library and add in my project now I am writing this code :

 String mPackage = "com.android.camera";
 String mClass = ".CropImage";
 intent.setComponent(new ComponentName(mPackage,mPackage+mClass));
 startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

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

I tried to write in AndroidManifest.xml in my project ass well but still the same error.

Upvotes: 0

Views: 2982

Answers (2)

Arsalan Saleem
Arsalan Saleem

Reputation: 361

Add activity like this in your android manifest file,

...
....
</activity>
        <!-- Declare the bundled CropImage Activity -->
        <activity android:name="com.android.camera.CropImage"/>
    </application>

</manifest>

Documentation indeed helps :) link

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1006604

Step #1: Add an <activity> element to your manifest pointing to com.android.camera.CropImage

Step #2: Use new Intent(this, com.android.camera.CropImage.class) to create your Intent

Step #3: There should be no step #3 AFAIK

Upvotes: 3

Related Questions