0

I'm using Room database.

I have a case where I want to show number of unread messages to the user.

I've created SQL QUERY

@Query("SELECT COUNT(${Notification.COLUMN_ID_LOCAL}) FROM ${Notification.TABLE_NAME} WHERE ${Notification.COLUMN_IS_READ} = :arg0")
    fun getUnreadedNotificationsCount(unread: Boolean = false): LiveData<Int>

Changes of the column Notification.COLUMN_IS_READ don't propagate to update my LiveData<Int>

This case is not handled or is it a bug of Room Library?

EDIT: please close this question

murt
  • 3,790
  • 4
  • 37
  • 48

1 Answers1

1

It's turn out I've provided different INSTANCES of my DataBaseRoomService, By configuring Dagger to provide the same instance it stared working

https://stackoverflow.com/a/44958478/2163045

murt
  • 3,790
  • 4
  • 37
  • 48