• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Using Dao to retreive values in real time

AsafKov

Newbie
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?
 
You raise multiple issues here, and it's difficult to understand what you're trying to achieve.
Can you provide any code to clarify the problem and explain what you're doing?
 
Back
Top Bottom