Created
April 7, 2019 18:41
-
-
Save gfreivasc/f3df8f3bfb8b77debafb046c9581497b 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 : ComponentActivity(R.layout.activity_main) { | |
private lateinit var viewModel: MainViewModel | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
viewModel = provideViewModel(MainViewModel::class.java) | |
textView.text = "${viewModel.count}" | |
button.setOnClickListener { | |
viewModel.inc() | |
textView.text = "${viewModel.count}" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment