Skip to content

Instantly share code, notes, and snippets.

@weverb2
Created January 22, 2019 00:34
Show Gist options
  • Save weverb2/15e9edca2991bd9b80b5896911f3caae to your computer and use it in GitHub Desktop.
Save weverb2/15e9edca2991bd9b80b5896911f3caae to your computer and use it in GitHub Desktop.
basic
class MainViewModel : ViewModel()
class MainActivity : AppCompatActivity() {
lateinit var viewModel: MainViewModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment