In <https://developer.android.com/jetpack/compose/...
# compose
k
In https://developer.android.com/jetpack/compose/interop#case-study-broadcastreceivers, the example shows tying a broadcast receiver to the lifecycle of a composable. However (if I understand it correctly), a composable follows the lifecycle of
onCreate
and
onDestroy
(and as long as it is in scope). Is there something I can do to tie it to
onStart
and
onStop
?
i
What is your use case?
k
If I understand the best practices correctly, I should tie the subscription lifecycle to
onStart
and
onStop
if I do not need to value when my UI is not in foreground (e.g.
MediaBrower
client (docs), bound service (docs)). Obviously I can handle it in my activity, but is there a way to do it in a composable?