Slide 34
Slide 34 text
Notify the UI when using ContentProviders
• Register observers
• CursorLoader gets notified and reloads the cursor
@Override!
public Cursor query(Uri uri, String[] projection, String selection,!
String[] selectionArgs, String sortOrder) {!
// perform the query!
cursor.setNotificationUri(getContext().getContentResolver(), uri);!
return cursor;!
}!
!
@Override!
public Uri insert(Uri uri, ContentValues values) {!
// ..!
getContext().getContentResolver().notifyChange(insertedId, null);!
// ..!
}!