Skip to content

Instantly share code, notes, and snippets.

@JoseAlcerreca
Last active April 2, 2019 14:23
Show Gist options
  • Save JoseAlcerreca/5dd62b2b5d2164696027d1724bfa57c2 to your computer and use it in GitHub Desktop.
Save JoseAlcerreca/5dd62b2b5d2164696027d1724bfa57c2 to your computer and use it in GitHub Desktop.
// Don't do this
public class MyViewModel extends AndroidViewModel {
public final MutableLiveData<String> statusLabel = new MutableLiveData<>();
public SampleViewModel(Application context) {
super(context);
statusLabel.setValue(context.getString(R.string.labelString));
}
}
@tasomaniac
Copy link

Constructor and class name do not match. Can you update it. Thanks.

@JoseAlcerreca
Copy link
Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment