permissionRequest proceed doesn't work due to KtxPermissionRequest.requestPermission being null
See original GitHub issueOverview
- When
onLocationShowRationale
get called and i want to proceedpermissionRequest
, system permission dialog is not showing up.
Environment
PermissionsDispatcher KTX
This doesn’t work cause KtxPermissionRequest.requestPermission
weakreference got lost and is null
private fun onLocationShowRationale(permissionRequest: PermissionRequest) {
findNavController().navigate(
RoundFormFragmentDirections.actionGlobalAlertDialog(
messageRes = R.string.NSLocationWhenInUseUsageDescription,
negativeButtonRes = R.string.global_cancel,
positiveButtonRes = R.string.dialog_gps_permissions_activate,
requestCode = REQUEST_CODE_PERMISSION_RATIONAL
)
)
setDialogPositiveClickListener {requestCode, _ ->
when (requestCode) {
REQUEST_CODE_PERMISSION_RATIONAL -> {
permissionRequest.proceed()
}
}
}
setDialogNegativeClickListener {requestCode, _ ->
when (requestCode) {
REQUEST_CODE_PERMISSION_RATIONAL -> {
permissionRequest.cancel()
findNavController().popBackStack()
}
}
}
}
But this works
private fun onLocationShowRationale(permissionRequest: PermissionRequest) {
permissionRequest.proceed()
}
Any help appreciated Thx!
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
PermissionsDispatcher/CHANGELOG.md at master - GitHub
Fix : permissionRequest proceed doesn't work due to KtxPermissionRequest.requestPermission being null. ktx: 1.1.1 2021/08/09.
Read more >Android M Permissions: onRequestPermissionsResult() not ...
I am in a fragment and I tried calling just requestPermissions, unfortunately it didn't work. I also tried what you mentioned and it...
Read more >PermissionsDispatcher - bytemeta
permissionRequest proceed doesn't work due to KtxPermissionRequest.requestPermission being null. aa86799. aa86799 CLOSED · Updated 1 year ago ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thx, I suppose https://github.com/permissions-dispatcher/PermissionsDispatcher/pull/742 would resolve the issue.
ktx-1.1.2 has been released.