Java Code Examples for android.content.ContentResolver#removeStatusChangeListener()

The following examples show how to use android.content.ContentResolver#removeStatusChangeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SyncTile.java    From GravityBox with Apache License 2.0 5 votes vote down vote up
@Override
public void setListening(boolean listening) {
    if (listening && mEnabled) {
        mSyncHandle = ContentResolver.addStatusChangeListener(
            ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS, mSyncObserver);
        getSyncState();
        if (DEBUG) log(getKey() + ": sync status listener registered");
    } else if (mSyncHandle != null){
        ContentResolver.removeStatusChangeListener(mSyncHandle);
        mSyncHandle = null;
        if (DEBUG) log(getKey() + ": sync status listener unregistered");
    }
}
 
Example 2
Source File: BaseFragment.java    From hr with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void onPause() {
    super.onPause();
    if (mSyncObserverHandle != null) {
        ContentResolver.removeStatusChangeListener(mSyncObserverHandle);
        mSyncObserverHandle = null;
    }
    try {
        parent().unregisterReceiver(syncFinishReceiver);
    } catch (Exception e) {
        // Skipping issue related to unregister receiver
    }
}
 
Example 3
Source File: EntryListFragment.java    From android-BasicSyncAdapter with Apache License 2.0 5 votes vote down vote up
@Override
public void onPause() {
    super.onPause();
    if (mSyncObserverHandle != null) {
        ContentResolver.removeStatusChangeListener(mSyncObserverHandle);
        mSyncObserverHandle = null;
    }
}
 
Example 4
Source File: BaseFragment.java    From framework with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void onPause() {
    super.onPause();
    if (mSyncObserverHandle != null) {
        ContentResolver.removeStatusChangeListener(mSyncObserverHandle);
        mSyncObserverHandle = null;
    }
    try {
        parent().unregisterReceiver(syncFinishReceiver);
    } catch (Exception e) {
        // Skipping issue related to unregister receiver
    }
}
 
Example 5
Source File: RunConditionMonitor.java    From syncthing-android with Mozilla Public License 2.0 5 votes vote down vote up
public void shutdown() {
    Log.v(TAG, "Shutting down");
    if (mSyncStatusObserverHandle != null) {
        ContentResolver.removeStatusChangeListener(mSyncStatusObserverHandle);
        mSyncStatusObserverHandle = null;
    }
    mReceiverManager.unregisterAllReceivers(mContext);
}
 
Example 6
Source File: AccountSnippet.java    From mobly-bundled-snippets with Apache License 2.0 4 votes vote down vote up
@Override
public void shutdown() {
    for (Object handle : mSyncStatusObserverHandles) {
        ContentResolver.removeStatusChangeListener(handle);
    }
}
 
Example 7
Source File: SystemSyncContentResolverDelegate.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void removeStatusChangeListener(Object handle) {
    ContentResolver.removeStatusChangeListener(handle);
}
 
Example 8
Source File: ContactListFragment.java    From haxsync with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onPause() {
     super.onPause();
     ContentResolver.removeStatusChangeListener(mContentProviderHandle);
   }
 
Example 9
Source File: SystemSyncContentResolverDelegate.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void removeStatusChangeListener(Object handle) {
    ContentResolver.removeStatusChangeListener(handle);
}
 
Example 10
Source File: SystemSyncContentResolverDelegate.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void removeStatusChangeListener(Object handle) {
    ContentResolver.removeStatusChangeListener(handle);
}