Is there onResume & onPause equivalent method ...
# compose
f
Is there onResume & onPause equivalent method in a composable function?
a
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
On resume i check for permission if it's given and update the button's layout
a
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