https://kotlinlang.org logo
Title
n

nwh

08/06/2018, 9:33 PM
Is there currently an easy way to wait for (suspend) something like a permissions request (which calls
onRequestPermissionsResult
as a callback)?
t

tateisu

08/07/2018, 6:34 AM
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

Allan Wang

08/07/2018, 5:20 PM
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

nwh

08/07/2018, 6:22 PM
Thanks, I'll take a look at it