Last active
March 26, 2019 14:16
-
-
Save JoseAlcerreca/4ee3548f311bbb7f844bd2c59699d7a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyViewModel : ViewModel() { | |
private val _name = MutableLiveData<String>().apply { value = "Ada" } | |
val name: LiveData<String> = _name // Expose the immutable version of the LiveData | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment