草庐IT

notifyChange

全部标签

android - cursor.setNotificationUri() 和 getContentResolver().notifyChange(uri,null) 之间的区别

我是android的新手,谁能告诉我cursor.setNotificationUri()和getContentResolver().notifyChange(uri,null)在实现时有什么区别内容提供商。我已经看到cursor.setNotificationUri()在query()方法中使用,同时更新或插入getContentResolver().notifyChange()被使用。我不太了解getContentResolver().notifyChange()通知解析器某些数据已更改,但cursor.setNotificationUri()做了什么?

android - CursorLoader 在 notifyChange 调用后不更新

我已经注册了一个CursorLoader,但它没有从我的ContentProvider接收更新事件的顺序是:在Fragment中,将CursorLoader注册到:getLoaderManager().initLoader(LOADER_FAVS_ID,null,this);注意我使用的是支持库版本,所以这个方法是android.support.v4.app.Fragment.getLoaderManager()注册了CursorLoader,在onLoadFinished加载了一个Cursor:@OverridepublicvoidonLoadFinished(Loaderloade

android getContentResolver().notifyChange() 不重启我的装载机

代码:首先是我的UrispublicstaticfinalStringPACKAGE="my.url.contentprovider";publicstaticfinalStringTABLE_NAME="NetworkTransaction";publicstaticfinalStringAUTHORITY=PACKAGE+".NetTransContentProvider";publicstaticfinalUriBASE_URI=Uri.parse("content://"+AUTHORITY);publicstaticfinalUriCONTENT_URI_ANY_OBSERV

java - ContentResolver.notifyChange 不工作

我想玩一个ContentProvider示例,但我遇到了一个我似乎无法解决的问题。这个例子包含一个Activity:importandroid.content.ContentUris;importandroid.content.ContentValues;importandroid.database.Cursor;importandroid.net.Uri;importandroid.support.v4.widget.SimpleCursorAdapter;importandroid.support.v7.app.ActionBarActivity;importandroid.os.

android - 如何 JUnit 测试 ContentResolver.notifyChange

我正在为ContentProvider编写测试,在insert中,我使用getContext().getContentResolver().notifyChange(mUri,空);我的测试类扩展ProviderTestCase2。我创建了以下模拟ContentObserver类:privateclassContentObserverMockextendsContentObserver{publicbooleanchanged=false;publicContentObserverMock(Handlerhandler){super(handler);//TODOAuto-genera

android - ContentResolver notifyChange 方法是否也通知了 Uri 的详细信息?

在应用数据期间,我使用带有Uri的notifyChange。假设我通知content://com.package.my/items。我还详细说明了显示来自content://com.package.my/items/1的数据的Activity。是否通知“一般”Uri也会通知“详细”Uri? 最佳答案 notifyChange方法发送详细URI的通知。但是,如果您在ContentResolver.registerContentObserver(Uriuri,booleannotifyForDescendents,ContentObse