Drjacky / ImagePicker

📸Image Picker for Android, Pick images from Gallery or Capture a new image with Camera🖼
https://github.com/Drjacky/ImagePicker
Apache License 2.0
230 stars 57 forks source link

registerForActivityResult not called when multiple setMultipleAllowed is true #80

Open shashankholla opened 1 year ago

shashankholla commented 1 year ago
 launcher=
                registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),(ActivityResult result)->{
                    if(result.getResultCode()==RESULT_OK){
                        Uri uri=result.getData().getData();
                        // Use the uri to load the image
                    }else if(result.getResultCode()==ImagePicker.RESULT_ERROR){
                        // Use ImagePicker.Companion.getError(result.getData()) to show an error
                    }
                });

 launcher.launch(ImagePicker.Companion.with(this)
                .maxResultSize(2000,2000,true)
                .galleryOnly()
                .setMultipleAllowed(true)
                .createIntent());

When I select multiple images and press SELECT in the photo picker, nothing happens. My breakpoint in " if(result.getResultCode()==RESULT_OK){" is not being hit.

Drjacky commented 1 year ago

Could you please attach a sample project in Java, to reproduce the issue?

cson2701 commented 1 year ago

Same here. The whole registerForActivityResult is not called.

Drjacky commented 1 year ago

@cson2701 Could you please attach a sample project in Java, to reproduce the issue?

91coders commented 1 year ago

how to get ActivityResult if we use setMultipleAllowed(true) in JAVA please explain

Drjacky commented 1 year ago

@91coders Could you please attach a sample project in Java, to reproduce the issue?