Skip to content

Instantly share code, notes, and snippets.

@JoseAlcerreca
Last active May 19, 2021 07:13
Show Gist options
  • Save JoseAlcerreca/0f8dbc0e2852c92f38d7e4862520ecd5 to your computer and use it in GitHub Desktop.
Save JoseAlcerreca/0f8dbc0e2852c92f38d7e4862520ecd5 to your computer and use it in GitHub Desktop.
// Expose resource IDs instead
public class MyViewModel extends ViewModel {
public final MutableLiveData<Int> statusLabel = new MutableLiveData<>();
public SampleViewModel() {
...
statusLabel.setValue(R.string.labelString);
}
}
@G-ManiX
Copy link

G-ManiX commented May 23, 2020

Why is the constructor not matching the Class name?

@nagaprakash2020
Copy link

What is SampleViewModel? Is that the constructor for MyViewModel class ?

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