jkwiecien / EasyImage

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

allowMultiple(true) isn't working for Samsung phones (again) #252

Closed uson1x closed 3 years ago

uson1x commented 3 years ago

Same issue was fixed here before: https://github.com/jkwiecien/EasyImage/issues/224

However, it has resurfaced once again.

Tested with EasyImage 3.2.0 on Samsung Galaxy A51 (Android 11).

This is how I initialize EasyImage:

easyImage = EasyImage.Builder(context!!)
            .setChooserType(ChooserType.CAMERA_AND_GALLERY)
            .allowMultiple(true)
            .build()

On Pixel 4a, the multiple selection works fine with the same code.

But on Samsung, the multiple selection UI is missing and it only select single photos:

unnamed-8

uson1x commented 3 years ago

Apparently, ChooserType.CAMERA_AND_GALLERY is using ACTION_PICK, which does not officially support EXTRA_ALLOW_MULTIPLE per https://stackoverflow.com/a/46017219/1138144.

The solution is to use ChooserType.CAMERA_AND_DOCUMENTS, which uses ACTION_GET_CONTENT. ACTION_GET_CONTENT supports multiple image selection on Samsung devices as well as on othres (via hold/long press gesture).

Closing this issue.