Last active
June 20, 2019 22:03
-
-
Save ceruleanotter/924b9b79df68354f7436d094c761bab5 to your computer and use it in GitHub Desktop.
ViewModel Integrations: Data Binding Example 1
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
override fun onActivityCreated(savedInstanceState: Bundle?) { | |
super.onActivityCreated(savedInstanceState) | |
myViewModel.name.observe(this, { newName -> | |
// Update the UI. In this case, a TextView. | |
nameTextView.text = newName | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment