Skip to content
Discussion options

You must be logged in to vote

ViewModel works differently on iOS vs. Android due to the Android Activity lifecycle. When there is a configuration change, such as rotating the device, changing to Dark theme, changing language, or increasing the font size, the Android Activity is destroyed, along with everything else it instantiated. The Android ViewModel class is a special lifecycle-aware component that is an exception to this rule; it will survive configuration changes. But that means that the Android class MainViewModel must extend the ViewModel class, which iOS doesn't have. So they can't both extend the Android ViewModel class. And in a more minor adjustment, we'll need to remove Android-specific LiveData from the V…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DanielSouzaBertoldi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #148 on February 11, 2021 21:57.