Skip to content

Instantly share code, notes, and snippets.

@ivacf
Last active September 24, 2015 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivacf/2842290cee04321f66c4 to your computer and use it in GitHub Desktop.
Save ivacf/2842290cee04321f66c4 to your computer and use it in GitHub Desktop.
Activity that sets its content view using data binding and a view model
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ProfileActivityBinding binding =
DataBindingUtil.setContentView(this, R.layout.profile_activity);
binding.setViewModel(new ProfileViewModel(this));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment