Skip to content

Instantly share code, notes, and snippets.

@vprabhu
Created May 23, 2018 06:38
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 vprabhu/79adaf72e3d3111e4c53872665a9cd28 to your computer and use it in GitHub Desktop.
Save vprabhu/79adaf72e3d3111e4c53872665a9cd28 to your computer and use it in GitHub Desktop.
val viewModel : TodoListViewModel = ViewModelProviders.of(this).get(TodoListViewModel::class.java)
viewModel.getAllTasksFromViewModel()?.observe(
this ,
Observer {
if (it != null) {
mTodoTaskAdapters = TodoTaskAdapters(this , it)
mTaskRecyclerView.layoutManager = LinearLayoutManager(
this.applicationContext ,
LinearLayout.VERTICAL , false)
mTaskRecyclerView.adapter = mTodoTaskAdapters
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment