guolindev / PermissionX

An open source Android library that makes handling runtime permissions extremely easy.
Apache License 2.0
3.54k stars 407 forks source link

Fragment InvisibleFragment not attached to a context #254

Open wangshaolei opened 1 year ago

wangshaolei commented 1 year ago

//PermissionX.init(this) // .permissions(Manifest.permission.SYSTEM_ALERTWINDOW) // .onExplainRequestReason { scope, deniedList -> // scope.showRequestReasonDialog(deniedList, "悬浮窗权限", "确定", "取消") // } // .onForwardToSettings { scope, deniedList -> // scope.showForwardToSettingsDialog(deniedList, "悬浮窗权限,去设置", "确定", "取消") // } // .request { allGranted, , _ -> // binding.swDrawWindow.isChecked = allGranted // checkPermission() // }

使用悬浮窗拦截时: 操作:第1次到设置页面不操作返回-> 第2次到设置 页面操作返回 -> 再点击其它标准权限拦截弹窗时崩溃