Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 1.98 KB

java_usage.md

File metadata and controls

44 lines (29 loc) · 1.98 KB

Still stuck? Try This Discussion here to a Plug and Play Solution to get you started.

So here are the steps to make the migration work for verison 3.3.6 or below.

Follow this guide first 🚨 How to migrate Android Image Cropper 🚨

Then follow the following strps to make it work.

Note: You need to use a single kotlin file and also enable kotlin compiler for your project to make it work.

Enable Compliler

goto Tools>Kotlin>Configure kotlin in this project and gradle sync the project

2022-04-18_01-53-44

Add Kotlin Code

Now create a kotlin file GetUri.kt

add following code fun CropImage.ActivityResult?.getUri(): Uri? { return this?.uriContent } 2022-04-20_01-21-42

Get Result

then in main onActivityResult()

 @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
            if (resultCode == RESULT_OK) {
                Uri resultUri = GetUriKt.getUri(CropImage.getActivityResult(data));
                Log.e(TAG, "onActivityResult: "+resultUri.toString());
            }
        }
    }

2022-04-20_01-22-59