Refactor with the new ViewModel class
Miquel Beltran
874

Your approach is contrary to the official documentation:

class MyViewModel extends ViewModel {
private final PostalCodeRepository repository;
public MyViewModel(PostalCodeRepository repository) {
this.repository = repository;
}
private LiveData<String> getPostalCode(String address) {
// DON'T DO THIS
return repository.getPostCode(address);
}
}
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.