-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ktx] onNeverAskAgain not called #767
Comments
Agree, I have the same issue
|
It can be reproduced on Android < 10. For example, in my case, I have used an Android 7.1.1 build on Emulator. |
I can also reproduce it on Android > 10. The references are null and so going back and forth the callbacks are not invoked. |
I'm able to reproduce the problem using ktx:1.1.4, I've found a workaround keeping a reference to the onNeverAskAgain lambda from the Fragment that is constructing the permission request using constructPermissionsRequest; see sample code:
Probably library should declare onNeverAskAgain as a val on PermissionsRequesterImpl. |
Overview
onNeverAskAgain callback is not called when "Don't ask again" is selected.
Expected
onNeverAskAgain callback is called, so I can show the appropriate UI.
Actual
onNeverAskAgain callback is not called.
Environment
Investigation
After debugging it, I can see that
onNeverAskAgain: WeakReference<Fun>?
is null inPermissionRequestViewModel.invoke()
.After reading through the closed issues, I came across #735. Wondering if the weakreference could be the issue? If I downgrade the ktx library to 1.0.4,
onNeverAskAgain
is successfully called.Reproducible steps
screen-20220315-112550.mp4
The text was updated successfully, but these errors were encountered: