Skip to content

Instantly share code, notes, and snippets.

@etonotieno
Last active January 28, 2019 09:06
Show Gist options
  • Save etonotieno/7eceb5d63252e479ec6f9c665b1436f9 to your computer and use it in GitHub Desktop.
Save etonotieno/7eceb5d63252e479ec6f9c665b1436f9 to your computer and use it in GitHub Desktop.
class NewsActivity : BaseActivity() {
private val newsViewModel = ViewModelProviders.of(this).get(NewsViewModel::class.java)
override fun onCreate(savedInstanceState :Bundle?) {
super.onCreate(savedInstanceState)
val newsBinding :ActivityNewsBinding = DataBindingUtil.setContentView(this, R.layout.activity_news)
newsBinding.setLifecycleOwner(this)
newsBinding.newsViewModel = newsViewModel
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment