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