KasemJaffer / media_picker_builder

A Flutter plugin that returns multimedia picker data such as folders and its content path list to build your own custom flutter picker
Apache License 2.0
23 stars 29 forks source link

Android 10 failing to load thumbnail paths #4

Closed miquelbeltran closed 5 years ago

miquelbeltran commented 5 years ago

Since I switched to Android 10 on my device, the library is failing to fetch the thumbnail paths.

Debugging I can see that the generateThumbnail method is correctly generating a Bitmap, however the content resolver query is returning an empty cursor:

                    context.contentResolver.query(
                            MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
                            arrayOf(MediaStore.Images.Thumbnails.DATA),
                            "${MediaStore.Images.Thumbnails.IMAGE_ID} = $fileId"
                                    + " AND ${MediaStore.Images.Thumbnails.KIND} = ${MediaStore.Images.Thumbnails.MINI_KIND}",
                            null,
                            null)?.use { cursor ->

// cursor is always empty

                        if (cursor.count > 0) {
                            cursor.moveToFirst()
                            path = cursor.getString(0)
                        }
                    }

I am testing with a Pixel 3a with Android 10.

KasemJaffer commented 5 years ago

Sorry about that I am working on it

KasemJaffer commented 5 years ago

Fixed now in version 1.2.2

miquelbeltran commented 5 years ago

thanks for the fix!