Android-image-cropper: Custom request code

Created on 26 Jun 2018  路  2Comments  路  Source: ArthurHub/Android-Image-Cropper

Add possibility to set custom request code (not only CROP_IMAGE_ACTIVITY_REQUEST_CODE) for multiple crop selections

Most helpful comment

Ok. I've made research and I was wrong. It is possible.

val intent = CropImage.activity().getIntent(context!!)
startActivityForResult(intent, CUSTOM_REQUEST_CODE)

All 2 comments

I agree, is there a possibility to get the result and set it for different images .. Something like this

case RESULT_AVATAR:
                if (resultCode == RESULT_OK) {
                    Uri selectedImage = imageReturnedIntent.getData();
                    img_avatar.setImageURI(selectedImage);
                }

                break;
case RESULT_BANNER:
                if (resultCode == RESULT_OK) {
                    Uri selectedImage = imageReturnedIntent.getData();
                    img_banner.setImageURI(selectedImage);
                }
                break;

Ok. I've made research and I was wrong. It is possible.

val intent = CropImage.activity().getIntent(context!!)
startActivityForResult(intent, CUSTOM_REQUEST_CODE)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Transformat picture Transformat  路  5Comments

jjimenez0611 picture jjimenez0611  路  4Comments

PujieWear picture PujieWear  路  5Comments

ben-j69 picture ben-j69  路  5Comments

willemevenwel picture willemevenwel  路  7Comments