-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix resolving strings in ViewModel #132
Comments
its true it improper to do this. in fact should not pass in a Usually my approach would be writing it in XML databinding |
Quick follow up - we're discussing this internally. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ViewModel should not be resolving strings from resources as shown in
https://github.com/googlesamples/android-sunflower/blob/4c8d9045d9662e5c659c9ee3dafc66d993e28968/app/src/main/java/com/google/samples/apps/sunflower/viewmodels/PlantAndGardenPlantingsViewModel.kt
If user changes locale on device, activity/fragment will be recreated but ViewModel will be retained with data, that might be invalid for new configuration/locale. Because this is sample referenced by official google documentation, it should not be showcasing invalid ViewModel usage.
ref. https://issuetracker.google.com/u/1/issues/111961971
The text was updated successfully, but these errors were encountered: