siralam / BSImagePicker

An image picker that extends BottomSheetDialogFragment. Camera and gallery all in one dialog. Single or Multi Selection.
202 stars 61 forks source link

Call in a fragment #12

Closed RobinovskyV closed 5 years ago

RobinovskyV commented 6 years ago

When used in a fragment, only the listeners are not working. But if I add them to Activity, they are called in it. Can I hurt them in the fragment?

  override fun onSingleImageSelected(uri: Uri?) {
    }

    override fun onMultiImageSelected(uriList: MutableList<Uri>?) {
    }
siralam commented 6 years ago

May you post the code of your Fragment?

mechdon commented 6 years ago

I have a similar issue. The Listeners onSingleImageSelected and onMultipleImageSelected do not respond when used in a fragment.

siralam commented 6 years ago

@mechdon Again, may you post the code of your Fragment?

siralam commented 6 years ago

One thing I suspect is, you are using .show(fragmentManager, "tag") instead of .show(childFragmentManager, "tag").

Hm, I should have mentioned this as well in my README.md.

mechdon commented 6 years ago

Thanks siralam, you're absolutely correct. It should be .show(childFragmentManager, "tag").

siralam commented 6 years ago

@mechdon You are welcomed~

@RobinovskyV How about you?