Glide版本:android
'com.github.bumptech.glide:glide:4.11.0'
加载图片的代码git
Glide.with(this) .load(imgLocalPath) .into(imageView);
在使用的过程当中,由于模拟器的问题一直使用Android8.0版本,手机又是9.0版本,项目sdk配置以下github
compileSdkVersion 30 buildToolsVersion "30.0.0" defaultConfig { applicationId "com.example.myapplication" minSdkVersion 26 targetSdkVersion 30 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }
选择相册中的图片后在android10上一直显示不出来,权限也都给了app
发现manifest少了句配置ide
android:requestLegacyExternalStorage="true"ui
加在<application>标签下this
也能够把targetSdkVersion改成28及如下,可是不建议url
缘由是Android 10文件存储机制修改为了沙盒模式,APP只能访问本身目录下的文件和公共媒体文件Android10如下,仍是使用旧的文件存储方式,Android 10即便获取读取权限,访问外部存储也受到了限制。.net