Is there currently an easy way to wait for (suspen...
# android
n
Is there currently an easy way to wait for (suspend) something like a permissions request (which calls
onRequestPermissionsResult
as a callback)?
t
There is no guarantee that Activity instances and processes are identical when the callback is invoked. Processes may be destroyed and regenerated while the activity is in the background state.
a
https://github.com/AllanWang/KAU/tree/dev/core/src/main/kotlin/ca/allanwang/kau/permissions I built some classes and a manager to decouple the permission result from the activity. It’s definitely true that the instance may change, but the worse case scenario is that the user will have to do the click/action again to continue the prompt.
n
Thanks, I'll take a look at it