// 检查外部存储挂载状态
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
// 检查读取和写入动态权限
if (ActivityCompat.checkSelfPermission(ThirdActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
} else {
// 如果没有,获取读取和写入动态权限
ActivityCompat.requestPermissions(ThirdActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, 100);
}
}
https://www.cnblogs.com/zanzg/p/9129375.html
标签:存储,动态,permission,STORAGE,Manifest,EXTERNAL,Android,权限 From: https://www.cnblogs.com/dearnotes/p/16751459.html