一个有希望的直截了当的问题:何时ContentResolver.notifyChange()
调用给定的 URI,是否会通知ContentObserver
观察该 URI 的后代URI?
例如,假设我有一个光标设置来观察特定资源的 URI:
Uri uriA = Uri.parse("content://" + AUTHORITY + "/orders/21");
cursor.setNotificationUri(getContext().getContentResolver(), uriA);
然后我通知ContentResolver
这个 URI 的祖先的更改(例如,因为我已经删除了所有订单):
Uri uriB = Uri.parse("content://" + AUTHORITY + "/orders");
getContext().getContentResolver().notifyChange(uriB, null);
我的Cursor
,注册观察uriA
,会收到通知吗?