0

I'm using GreenDao 3 and I'd like to know what is the URI to be used to listen to DB changes. I'm using this code:

Uri uri = Uri.parse("content://" + BuildConfig.APPLICATION_ID + "/table1");
getContext().getContentResolver().registerContentObserver(uri, false, mObserver);

However, after an insert/updated or some change on table1, nothing happen at onChange method on mObserver variable.

Am I doing something wrong? Is the URI wrong? What should I do to make it work?

Thanks

Douglas Fornaro
  • 2,017
  • 2
  • 22
  • 30
  • and of course you are updating it via ContentProvider? – Selvin Nov 16 '16 at 23:02
  • How using GreenDao 3? – Douglas Fornaro Nov 17 '16 at 10:07
  • I have no idea ... but `registerContentObserver` is part of ContentProvider API ... Why do you think that GreenDao will automagically use it? Obviously it will "not work" until someones call `ContentREsolver.notifyChange` with the uri which match your uri – Selvin Nov 17 '16 at 10:08

0 Answers0