jkwiecien / EasyImage

Library for picking pictures from gallery or camera
1.75k stars 303 forks source link

Not Working For Fragments #226

Open VishalTuran opened 4 years ago

VishalTuran commented 4 years ago

onActivityResult not working with fragment.

ghost commented 4 years ago

What you need to do is call the onActivityResult from your root activity. So in the override method, check if the fragment is active by using findFragmentByTag("Tag") and then check if(fragment != null), call fragment.onActivityResult

ghost commented 4 years ago

Or just put your onActivityResult functionality in your main activity for that fragment

migu-el commented 1 year ago

Hi!, in my case I have an activity with ViewPagerAdapter that cordinate 2 tabs(fragment by tab). The root activity does not have the EasyImage references.

The 2nd tab(fragment) contains the gallery and related logic for photos.

The OnActivityResult in the 2nd fragment does not allow the implement of easyImage.handleActivityResult overrride onMediaFilesPicked method.

Thanks in advance! easyimage