使用fileprovider.geturifile在滑行上显示存储图像..()
请在我的androidManifest.xml中添加提供商权限XML,如何从Glide Android 11中的文件路径显示图像,在Android SDK中显示的图像sdk sdk yound thit11。Glide.plide.plide.with
public Uri getUri(Context context) {
return FileProvider.getUriForFile(context, context.getPackageName() + ".provider", getFile());
}
(context).load(status.geturi()) .into(holder.thumbnail);
FileProvider XML,范围存储需要
<?xml version="1.0" encoding="UTF-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
<root-path name="external_files" path="/storage/"/>
</paths>
在我的Android清单文件中我有以下XML标签,我的android 11我做错了
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.oasis.metasaver.provider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
Pls I have add the provider permission xml in my androidmanifest.xml , how to show image from File Path in Glide android 11, image showing in Android SDK lower that 11.
public Uri getUri(Context context) {
return FileProvider.getUriForFile(context, context.getPackageName() + ".provider", getFile());
}
Glide.with(context).load(status.getUri()).into(holder.thumbnail);
FileProvider xml, scoped Storage requires this
<?xml version="1.0" encoding="UTF-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
<root-path name="external_files" path="/storage/"/>
</paths>
In my android manifest file I have the following xml tags, my be I'm doing it wrong for android 11
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.oasis.metasaver.provider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论