Added AsyncTaskLoader subclass for loading models.#35
Added AsyncTaskLoader subclass for loading models.#35blork wants to merge 1 commit intopardom-zz:masterfrom
Conversation
Useful for backing listviews.
|
!! I was working on a ModelLoader as well that used the ContentProvider to listen for changes, but this method is a lot better |
There was a problem hiding this comment.
AsyncTaskLoader should be imported from the support lib for compatibility.
There was a problem hiding this comment.
Good point, I wasn't sure which version to import though - I didn't want to introduce external dependancies.
|
@ad4b37b8f17f5fdadfa997e3c87d892febbf8168 adds v4 of the support library. Otherwise this wouldn’t be froyo-compatible. Please note, that this pull-request relies on @b7da5f8db3b9d1f30bafc1582bb66de26e5b6972. |
|
👍 Very nice work, @blork! |
|
Nice work @blork. However in an effort to keep AA lightweight and focused on ORM tasks, I think this fits best in a different project. Perhaps a utils library. |
|
Hi Michael! I’m using this all the time and it still applies cleanly (just a minor conflict in From.java). As this is a standard pattern in android, would you perhaps reconsider? |
|
I'm happy to clean it up and to another pull, or as @pardom suggested I could wrap it up in it's own jar, perhaps ActiveAndroid-Extras.
Edit: scratch that, I forgot that |
|
I've put together an updated version which can be used without changes to AA - here's a gist. |
|
I've added a repo ActiveAndroid-Loaders with the ModelLoader functionality. It's working well for me. |
Loaders are great for backing listviews which update as the underlying data changes. I put this together for AA - it works well in my experience.