coomar2841 / image-chooser-library

An Easy Image/Video Chooser Library for your Android Apps
646 stars 192 forks source link

OnImageChosen didn't called. #78

Closed ghost closed 9 years ago

ghost commented 9 years ago

I have implemented ImageChooserListener to my fragment, call this method on button click:

    private void chooseImage() {
        ImageChooserManager imageChooserManager = new ImageChooserManager(this,
                ChooserType.REQUEST_PICK_PICTURE, "myfolder", true);
        imageChooserManager.setImageChooserListener(this);
        try {
            String filePath = imageChooserManager.choose();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

but after I choose image OnImageChosen didn't call.

    @Override
    public void onImageChosen(ChosenImage chosenImage) {
        Log.d("SYSOUT", "WHAAAAAAT?");
        addPhotoButton.setBackground(Drawable.createFromPath(chosenImage.getFilePathOriginal()));

    }

What could be the problem?

@dalinaum , @coomar2841 , @dimka-kopitkov , @abdyer , @juandiana

Thanks.

abdyer commented 9 years ago

Did you call imageChooserManager.submit(requestCode, data) in onActivityResult as shown here?

ghost commented 9 years ago

I missed it. It works now. Thank you!