Architecture-samples: dev-todo-mvvm-live should not be resolving strings in ViewModel

Created on 1 Aug 2018  路  1Comment  路  Source: android/architecture-samples

ViewModel should not be resolving strings from resources as shown in
https://github.com/googlesamples/android-architecture/blob/dev-todo-mvvm-live/todoapp/app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsViewModel.java

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

bug

Most helpful comment

@karczews thanks, fixed.

>All comments

@karczews thanks, fixed.

Was this page helpful?
0 / 5 - 0 ratings