android / android/architecture-samples

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

Open
#574 1 comment 6 reactions 1 assignee Claimed by @JoseAlcerreca View on GitHub
bug
Dominant language
Kotlin
Stars
45.8k
Forks
11.9k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.