Last active
July 5, 2017 11:01
-
-
Save AkshayChordiya/e9d5aec2b0dc1016b75ac001f68389c0 to your computer and use it in GitHub Desktop.
Main Activity with ViewModel instance
This file contains 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 : LifecycleActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
// Get the ViewModel instance | |
val simpleViewModel = ViewModelProviders.of(this).get(SimpleViewModel::class.java) | |
val data = simpleViewModel.getDataList() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment