siralam / BSImagePicker

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

Getting images uri #21

Closed rocks860 closed 5 years ago

rocks860 commented 5 years ago

Thank you for this sweet picker. I finally integrated it with my project, and no errors at the moment. But I am a little confused about retrieving the 6 images uri. The way I know it is if(requestCode == GALLERY_REQUEST && resultCode == RESULT_OK){ mSelectedUri = data.getData(); } But here in onMultiImageSelected(List<Uri> uriList, String tag) it's an image view, and I don't know how to get ivImage1 ivImage2 ivImage3 ivImage4 ivImage5 ivImage6 I hope you can help me, thank you

siralam commented 5 years ago

Hello @rocks860 ,

First, && resultCode == RESULT_OK which is used in onActivityResult should not be used here.

Second, the ImageViews are defined by yourself and the library is only returning Uri to you, and you should use your own way (e.g. image loading libraries) to load Uri into your ImageViews.

rocks860 commented 5 years ago

I was confused a bit on how to retrieve the uri, but I figured it. As simple as : mSelectedUri = uriList.get(i);