0

I am using sqlbrite for my chatting app. I need to observe a database, but the range is not fixed.

Observable<Query> messages = db.createQuery("messages", "SELECT * FROM users WHERE timestamp > ? ");

I need to pass in an argument newestMessage.sentTime, but newestMessage keeps updating as soon as a new message comes. So I cant just pass in the current newestMessage as argument.

OMGPOP
  • 1,995
  • 8
  • 52
  • 95

1 Answers1

0

The results of a single query execution never change and represent a snapshot. To get more messages, you have to re-execute the query, i.e., call createQuery again.

CL.
  • 173,858
  • 17
  • 217
  • 259