coomar2841 / image-chooser-library

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

Issue with integrating Fragements #66

Closed jagatappv closed 8 years ago

jagatappv commented 9 years ago

Hey,

I have tried this library.

Working fine with activity.

Now i have to use this library in fragment but its not returning result.

Can you help me to integrate this with fragment?

Thanks

coomar2841 commented 9 years ago

Could you put logs and see on both Activity's and Fragment's onActivityResult parts, to see if it is getting called in any one of them?

jagatappv commented 9 years ago

Hey,

thanks for replay

I have putted log inside both Activity and Fragment 's onActivityResult

I have called the code from fragment and receive result in activity's method.

How can i used within fragment??

Let me add my code that i am calling from fragment,

private void chooseImage() { int chooserType = ChooserType.REQUEST_PICK_PICTURE; imageChooserManager = new ImageChooserManager(this, ChooserType.REQUEST_PICK_PICTURE, "myfolder", true); imageChooserManager.setImageChooserListener(this); try { //pbar.setVisibility(View.VISIBLE); filePath = imageChooserManager.choose();

    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
coomar2841 commented 9 years ago

Have you implemented onSaveInstance and onRestore? May be your activity is getting killed? Put logs in your onDestroy methods to confirm.

jagatappv commented 9 years ago

I have added My fragment inside one activity. So i am sure its not killed, otherwise the fragment itself killed and onRestoreInstance not worked for fragment.

coomar2841 commented 9 years ago

Could you post some logs?

jagatappv commented 9 years ago

Sorry , But i am not getting any log. I just have call above code (chooseImage()) ,i have select image from gallery, then i am not getting any result from onActivitiResult .

coomar2841 commented 8 years ago

Can you try out the sample and look at the source for the fragment example? Closing this for now. Please open a new one if the issue persists.