首页 > 其他分享 >Andorid 11获取外部存储权限方法

Andorid 11获取外部存储权限方法

时间:2022-09-30 16:56:53浏览次数:59  
标签:11 Toast 存储 MANAGE VERSION intent Andorid 权限

    private void requestmanageexternalstorage_Permission() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
            // 先判断有没有权限
            if (Environment.isExternalStorageManager()) {
                Toast.makeText(this, "Android VERSION  R OR ABOVE,HAVE MANAGE_EXTERNAL_STORAGE GRANTED!", Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(this, "Android VERSION  R OR ABOVE,NO MANAGE_EXTERNAL_STORAGE GRANTED!", Toast.LENGTH_LONG).show();
                Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
                intent.setData(Uri.parse("package:" + this.getPackageName()));
                startActivityForResult(intent, 10);
            }
        }
    }

Andorid11之后的外部存储权限的方法

标签:11,Toast,存储,MANAGE,VERSION,intent,Andorid,权限
From: https://www.cnblogs.com/fengfenghuifei/p/16745420.html

相关文章