Is there a way to remember things across configura...
# compose
s
Is there a way to remember things across configuration changes without AAC VM? My specific use case is that I am using a MediaPlayer inside a class that I am now `remember`ing that I would like to persist when the user selects dark mode for example. But putting that inside a rememberSaveable seems a bit tricky, since I can’t persist its internal state because rememberSaveable will try to re-create it even after process death. Is ViewModel my only solution here for this use case of “persist it across config changes, but not across process death”?
a
You can override config changes completely if you're doing a compose first Activity
s
Is that specified somewhere in the documentation on how to do this properly?
a
It's somewhere here in slack 😁. Not in official docs yet I believe. I might be outdated
s
Very interesting yeah, my app is definitely not all compose, but it can happen on a per-activity basis so that’s something I need to test. And for activities that are mixed, I guess AAC VM actually seems to be the only proper answer.
a
What's a mixed activity? If it's compose first, the views are wrapped so I think you can still use it.
s
I was referring to the opposite situation, a View-based activity with some ComposeViews here and there, for example inside RecyclerViews.
a
Ah. Yes, in that case
🙏 1