Example usage for android.database ContentObservable ContentObservable

List of usage examples for android.database ContentObservable ContentObservable

Introduction

In this page you can find the example usage for android.database ContentObservable ContentObservable.

Prototype

ContentObservable

Source Link

Usage

From source file:com.android.emailcommon.provider.EmailContent.java

/**
 * Register a content observer to be notified when the data underlying this object changes
 * @param observer ContentObserver to register
 *///  w  ww  .  j  a v  a 2  s  . com
public synchronized void registerObserver(final Context context, final ContentObserver observer) {
    if (mSelfObserver == null) {
        mSelfObserver = new SelfContentObserver(this);
        context.getContentResolver().registerContentObserver(getContentNotificationUri(), true, mSelfObserver);
        mObservable = new ContentObservable();
    }
    mObservable.registerObserver(observer);
}