j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 367 forks source link

Watch for changes to the underlying dataset #22

Closed emmby closed 9 years ago

emmby commented 10 years ago

Loaders are supposed to watch for changes to the underlying dataset. Use Dao.registerObserver and Dao.unregisterObserver to start and stop watching for changes.

emmby commented 10 years ago

whoops, you'll also need

    @Override
    public void onChange() {
        onContentChanged();
    }
emmby commented 10 years ago

Hm, I don't see a way to update a PR that I created via the web interface. Clearly, I should not take this shortcut next time :)

VincentJousse commented 9 years ago

This should definitively be merged, the OrmLiteCursorLoader class implements the DaoObserver interface whereas BaseOrmLiteLoader doesn't. No reason for this IMOO.

j256 commented 9 years ago

Done.

j256 commented 9 years ago

This generates compilation failures in OrmLitePreparedQueryLoader and OrmLiteQueryForAllLoader because of no onChange() method. What am I missing?

VincentJousse commented 9 years ago

See 2nd comment in this thread from @emmby . (and also the other comments !!)

j256 commented 9 years ago

Duh. Ok. Fixed.