Closed stevan-milovanovic closed 1 year ago
Hey. Yes, it should work. Could you please provide a reproducible sample?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Pager state doesn't preserve the state if it is declared inside of the composable function with
rememberPagerState
.With each recreation of the composable containing pagerState new pagerState was created, which triggered
snapshotFlow
collection and I received value 0 because of that, even though value should have been different.I mitigated this issue with logic of storing pagerState in the view model, but since
rememberPagerState
implementation usesrememberSaveable
I would assume that it should survive activity recreation, but this doesn't seem to be the case.