Hi,
I'm trying to implement RoomDatabase in my Calendar project, from the ground up (meaning, I didn't have any SQLite foundation) and I don't understand how to approach some issue.
What I'm trying to do is have the user pick a data in a calendar, which opens a fragment of the events he has created previously. At the moment, my viewModel, upon creation, gets all the events from the repository, which in turn gets all the events from the Dao class. What I need is a way of providing a time-stamp (which represents the date-column in the database) to search events by in the Dao, but I have no idea how to do it.
The problem is, AndroidViewModel is created via ViewModelProviders and not a customizable costructor.
I tried multiple things but it was kinda like shooting in the dark.
Any suggestion?
I'm trying to implement RoomDatabase in my Calendar project, from the ground up (meaning, I didn't have any SQLite foundation) and I don't understand how to approach some issue.
What I'm trying to do is have the user pick a data in a calendar, which opens a fragment of the events he has created previously. At the moment, my viewModel, upon creation, gets all the events from the repository, which in turn gets all the events from the Dao class. What I need is a way of providing a time-stamp (which represents the date-column in the database) to search events by in the Dao, but I have no idea how to do it.
The problem is, AndroidViewModel is created via ViewModelProviders and not a customizable costructor.
I tried multiple things but it was kinda like shooting in the dark.
Any suggestion?