https://kotlinlang.org logo
#compose
Title
# compose
f

FunkyMuse

10/31/2020, 10:54 PM
Is there onResume & onPause equivalent method in a composable function?
a

Adam Powell

10/31/2020, 11:46 PM
strictly speaking you can use
LifecycleObserver
,
LifecycleOwnerAmbient
and
DisposableEffect
together to get exactly that, but there might be a better fit for what you're doing. What's the use case?
f

FunkyMuse

11/01/2020, 9:48 AM
On resume i check for permission if it's given and update the button's layout
a

Adam Powell

11/01/2020, 2:20 PM
The above should work fine then. We might provide some canned version of it in the stock libraries later but its implementation would be exactly the above
👍 1
3 Views