/** * 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; } };
时间: 2024-09-23 21:28:44