I have created a small application, trying to understand the functionality of the LoaderManager
and CursorLoader
-classes.
I have implemented LoaderCallbacks<Cursor>
on my FragmentActivity
-class and everything works fine, except the fact that when I update my data via ContentResolver.update()
or ContentResolver.insert()
-methods, onLoadFinished()
is not called and as a result my data doesn't update.
I have a custom ContentProvider and I am wondering if the problem is in my ContentProvider not notifying that the data changed or something else.
getContext().getContentResolver().notifyChange(Uri,..);
in your update/insert ContentProvider methods implementation ? do you callcursor.setNotificationUri(getContext().getContentResolver(), uri);
before return it from query method in your ContentProvider – Huonghupeh