Last active
March 7, 2018 15:05
-
-
Save jakubkinst/59ef2ff5b1b72ac2a056ba3c5f2d5103 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 MainActivity : AppCompatActivity(){ | |
val viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java) | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
val titleView = findViewById<TextView>(R.id.title) | |
viewModel.myliveData.observe(this, Observer { | |
titleView.setText(it.title) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment