if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){
if (Environment.isExternalStorageManager()) {
//跳转到设置界面引导用户打开
val intent = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION)
intent.setData(Uri.parse("package:" + packageName))
startActivity(intent)
}else{
// 有了权限后,在申请读写权限,
}
}
网友评论