Pickpocket icon indicating copy to clipboard operation
Pickpocket copied to clipboard

Flow does not notify when data changes

Open raheemadamboev opened this issue 2 years ago • 2 comments

In my case, I'm using calendarFlow() and observing for calendar events. If I insert new event from calendar, it does not notify new changes.

How can I solve it?

raheemadamboev avatar Mar 18 '22 13:03 raheemadamboev

I'm not sure

evilthreads669966 avatar Jul 08 '22 16:07 evilthreads669966

I will let you know shortly

evilthreads669966 avatar Jul 08 '22 16:07 evilthreads669966

I don't think that you can flow off of a content provider. You can flow off of a room database table. It's not going to give you that,. You need a Content Observer. I'll make you a content observer library. Content Providers are also a SQLITE table as well. The proper way to do it is to query all from the content provider then you set a Content Observer on the same table and add new ones to your collection.

@raheemadamboev

evilthreads669966 avatar Oct 12 '22 15:10 evilthreads669966

This is a content provider library as stated in the libraries description

evilthreads669966 avatar Oct 12 '22 15:10 evilthreads669966

Flowing from a content provider is more for using algorithms.

evilthreads669966 avatar Oct 12 '22 15:10 evilthreads669966

This isn't a bug.

evilthreads669966 avatar Oct 12 '22 15:10 evilthreads669966

So you would still use my library to do this. You use Pickpocket to get the current events and then you set a content observer on the database table.

evilthreads669966 avatar Oct 12 '22 15:10 evilthreads669966

I spoke too much. But you want content observer feature added to the library. noted.

evilthreads669966 avatar Oct 12 '22 17:10 evilthreads669966

also ContentObserver is best implemented as an inner class that has context that way you have access to the android context if you need it.

evilthreads669966 avatar Oct 12 '22 18:10 evilthreads669966