Open Tanuyoki opened 6 months ago
下面代码使用 MANAGE_EXTERNAL_STORAGE 并且不进行 showRequestReasonDialog 就能复现 这时不会跳转到设置页,直接返回 deniedList
private fun request() { val permissions = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { listOf(Manifest.permission.MANAGE_EXTERNAL_STORAGE) } else { listOf( Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE) } PermissionX.init(this) .permissions(permissions) .onExplainRequestReason { scope, deniedList -> // val message = "PermissionX需要您同意以下权限才能正常使用" // scope.showRequestReasonDialog(deniedList, message, "Allow", "Deny") } .request { allGranted, grantedList, deniedList -> Toast.makeText(this, "granted list $grantedList, \ndenied list $deniedList", Toast.LENGTH_SHORT).show() } }
遇到同样问题
下面代码使用 MANAGE_EXTERNAL_STORAGE 并且不进行 showRequestReasonDialog 就能复现 这时不会跳转到设置页,直接返回 deniedList