本文整理匯總了Java中android.database.ContentObserver.dispatchChange方法的典型用法代碼示例。如果您正苦於以下問題:Java ContentObserver.dispatchChange方法的具體用法?Java ContentObserver.dispatchChange怎麽用?Java ContentObserver.dispatchChange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.database.ContentObserver
的用法示例。
在下文中一共展示了ContentObserver.dispatchChange方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: notifyChange
import android.database.ContentObserver; //導入方法依賴的package包/類
@Override
public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) {
super.notifyChange(uri, observer, syncToNetwork);
if (DEBUG) {
Log.d(TAG, "onChanged(uri=" + uri + ", observer=" + observer + ") - Notification "
+ (mNotifyDisabled ? "disabled" : "enabled"));
}
if (mNotifyDisabled) {
return;
}
// Do not call {@link ContentObserver#onChange} directly to run it on the correct
// thread.
if (observer != null) {
observer.dispatchChange(false, uri);
} else {
mChannelDataManager.getContentObserver().dispatchChange(false, uri);
}
}
示例2: notifyChange
import android.database.ContentObserver; //導入方法依賴的package包/類
@Override
public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) {
super.notifyChange(uri, observer, syncToNetwork);
if (DEBUG) {
Log.d(TAG, "onChanged(uri=" + uri + ")");
}
if (observer != null) {
observer.dispatchChange(false, uri);
} else {
mProgramDataManager.getContentObserver().dispatchChange(false, uri);
}
}
示例3: registerContentObserver
import android.database.ContentObserver; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public void registerContentObserver(ContentObserver observer) {
mContentObservable.registerObserver(observer);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
for (Uri changedByUri : mChangedByUris) {
observer.dispatchChange(false, changedByUri);
}
} else {
if (!mChangedByUris.isEmpty()) {
observer.dispatchChange(false);
}
}
}
示例4: notifyChange
import android.database.ContentObserver; //導入方法依賴的package包/類
@Implementation
public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) {
notifiedUris.add(new NotifiedUri(uri, observer, syncToNetwork));
// TODO does not support multiple observers for a URI
ContentObserver obs = contentObservers.get(uri);
if ( obs != null && obs != observer ) {
obs.dispatchChange( false, uri );
}
if ( observer != null && observer.deliverSelfNotifications() ) {
observer.dispatchChange( true, uri );
}
}
示例5: registerContentObserver
import android.database.ContentObserver; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public void registerContentObserver(ContentObserver observer) {
mContentObservable.registerObserver(observer);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
dispatchChangeForUris(observer);
} else {
if (!mChangedByUris.isEmpty()) {
observer.dispatchChange(false);
}
}
}
示例6: dispatchChangeForUris
import android.database.ContentObserver; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void dispatchChangeForUris(ContentObserver observer) {
for (Uri changedByUri : new ArrayList<>(mChangedByUris)) {
observer.dispatchChange(false, changedByUri);
}
}