Cursor c = qb.query(mTasksDb,
projection,
selection, selectionArgs,
null, null,
orderBy);
c.setNotificationUri(getContext().getContentResolver(), uri);
return c;
}
In above query implementation for content provider,
can I delete the line
c.setNotificationUri(getContext().getContentResolver(),
uri) ??
You can certainly do that if you want to, but if you do, then you won't be
notified if someone goes and modifies the data.
本文探讨了ContentProvider中setNotificationUri方法的作用,解释了该方法如何确保数据更改时能够接收到通知。如果移除此方法调用,虽然不会引发错误,但应用程序将不再能响应数据的变动。
2118

被折叠的 条评论
为什么被折叠?



