This works as designed, it will trigger everytime the composable is rendered first but only after onCreate
Alex
11/22/2023, 10:28 AM
Do you also intend to sync when the device is rotated, e.g. on configuration changes or do you only want to sync when the activity is created for the first time?
d
Divyansh Kushwaha
11/22/2023, 10:53 AM
When (Activity is created for the first time) && (action is LAUNCH_WITH_SYNC)
i
Ian Lake
11/22/2023, 3:33 PM
Any LifecycleEventObserver you add is always "caught up" to what state you're in (that way you're guaranteed to get an ON_CREATE before an ON_START, etc. and the reverse the other way down) so you'd need to track if this is the first time you've received a particular event separately