While making a to-do list for Android in Kotlin, I was trying to pass the "id" in the brackets but got an error. Also, the tutorial I learned it from was working fine and I am facing this issue. How to solve this problem?
I was to expect it to work fine. All other files are correct only this one has a problem. And for that reason, my app's not running.
My implementation of getATodoById inside TodoDAO -
Check out Pass simple parameters to a query. You should pass id
as an argument to both the method and the query:
@Query("SELECT * FROM `todo-table` WHERE id = :id")
abstract fun getATodoById(id: Int): Flow<Todo>