use of android.database.ContentObserver in project 360-Engine-for-Android by 360.
the class NativeContactsApi1 method registerObserver.
/**
* @see NativeContactsApi#registerObserver(ContactsObserver)
*/
@Override
public void registerObserver(ContactsObserver observer) {
if (mContactsObserver != null) {
throw new RuntimeException("NativeContactsApi1.registerObserver(): current implementation only supports one observer" + " at a time... Please unregister first.");
}
mContactsObserver = observer;
mNativeObserver = new ContentObserver(new Handler()) {
@Override
public void onChange(boolean selfChange) {
mContactsObserver.onChange();
}
};
mCr.registerContentObserver(Contacts.CONTENT_URI, true, mNativeObserver);
}
Aggregations