本文整理汇总了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);
}
}