Skip to content Skip to sidebar Skip to footer

Writing Data Managed By A Loadermanager

When using a LoaderManager, do I still manage my database writes the way I have in the past and let the Loader pick up the changes? I am in the process of converting and adding fun

Solution 1:

If you are using CursorLoader, and you do all your database updates via the ContentProvider you used with CursorLoader, the loader and its Cursor will be notified of changes, so everything will be handled for you.

If you are not using CursorLoader, it is your responsibility to somehow update your own Cursor. For example, my LoaderEx project has a SQLiteCursorLoader that works directly with a SQLiteOpenHelper, and it offers insert(), update(), delete(), and execSql() methods on the Loader, so we can update the Cursor accordingly.

Post a Comment for "Writing Data Managed By A Loadermanager"