During applying data I use notifyChange with an Uri.
Let’s say I notify content://com.package.my/items.
I have also detail Activity that displays data from content://com.package.my/items/1.
Does notifying ‘general’ Uri results also in ‘detail’ Uri being notified?
The method
notifyChangesends a notification for the detailed URI.But if you register a
ContentObserveratContentResolver.registerContentObserver(Uri uri, boolean notifyForDescendents, ContentObserver observer)you can register a baseUrito be notified if any descendantUrihas been changed (is used to send change notification).I assume you have a
ContentProviderand that you query aCursorfrom thatContentProviderthrough aContentResolver. If you set the notification URI on theCursorthat you return in theContentProvider.query()method, yourCursorAdapterwill automatically update the view if the notification URI or any of its descendants change (see source of Cursor). If you change the data with youContentProviderbe sure to send a notification inupdate,insert,deleteof yourContentProvider.