更新时间:2021-07-04 10:25:49
从策略上看,您似乎没有READ_EXTERNAL_STORAGE
权限,该权限
Tactically, it would appear that you do not have the READ_EXTERNAL_STORAGE
permission, which you need to request in the manifest and at runtime.
除此之外:
您的query()
无需返回DATA
列
不要求DATA
列具有值
不要求DATA
列具有文件系统路径
There is no requirement that the DATA
column have a filesystem path
即使READ_EXTERNAL_STORAGE
特别是,可以确保您的代码在Android Q上失败,并且在许多其他设备上的许多用户也很可能失败.
In particular, it is guaranteed that your code will fail on Android Q, and it is very likely to fail for lots of users on lots of other devices as well.
将Uri
(imageUri
)与ContentResolver
一起使用,以获取InputStream
(或者可能是FileDescriptor
)传递给您的库.
Use the Uri
(imageUri
) with ContentResolver
to get an InputStream
(or perhaps a FileDescriptor
) to pass to your library.