Created
May 23, 2018 06:33
-
-
Save vprabhu/b0f3b3d1903d105bb5d92df1364e4725 to your computer and use it in GitHub Desktop.
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 TodoListViewModel : AndroidViewModel { | |
private var mTodoTaskList : LiveData<List<TodoTask>> ?= null | |
constructor(application: Application) : super(application) { | |
val appDatabase : AppDatabase? = AppDatabase.getInstance(this.getApplication()) | |
mTodoTaskList = appDatabase?.todoTaskDao()?.getallTasks() | |
} | |
fun getAllTasksFromViewModel() : LiveData<List<TodoTask>>? { | |
return mTodoTaskList | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment