Android 通过ContentProvider数据库更新UI

1.http://blog.csdn.net/jdsjlzx/article/details/43702429

2./**

* Register an observer for provider status changes - we will need to

* reflect them in the UI.

*/

private void registerObserver() {

getContentResolver().registerContentObserver(

ContactsContract.Contacts.CONTENT_URI, true, mObserver);

getContentResolver().registerContentObserver(

CallLog.Calls.CONTENT_URI, true, mObserver);

}

private void unregisterObserver() {

getContentResolver().unregisterContentObserver(mObserver);

}

private ContentObserver mObserver = new ContentObserver(new Handler()) {

@Override

public void onChange(boolean selfChange) {

isContactChanged = true;

}

};

你可能感兴趣的:(Android 通过ContentProvider数据库更新UI)