ContentResolver unregisterContentObserver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ContentResolver unregisterContentObserver method.

This code example shows how to use the following methods:unregisterContentObserver
    @Override 
    public void onPause() { 
        super.onPause(); 
 
        getActivity().unregisterReceiver(mPackageReceiver);
        mCR.unregisterContentObserver(mSettingsObserver);
    } 
 
    void loadEnabledListeners() { 
        mEnabledListeners.clear();
        final String flat = Settings.Secure.getString(mCR,
                Settings.Secure.ENABLED_NOTIFICATION_LISTENERS); 
        if (flat != null && !"".equals(flat)) {
            final String[] names = flat.split(":");
            for (int i = 0; i < names.length; i++) {
                final ComponentName cn = ComponentName.unflattenFromString(names[i]);
                if (cn != null) {
                    mEnabledListeners.add(cn);
                } 
            } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:unregisterContentObserver
    public static void registerHistoryObserver(ContentResolver cr, ContentObserver observer) {
        sDb.registerHistoryObserver(cr, observer);
    } 
 
    public static void unregisterContentObserver(ContentResolver cr, ContentObserver observer) {
        cr.unregisterContentObserver(observer);
    } 
 
    public static int getCount(ContentResolver cr, String database) {
        return sDb.getCount(cr, database);
    } 
 
    public static void pinSite(ContentResolver cr, String url, String title, int position) {
        sDb.pinSite(cr, url, title, position);
    } 
 
    public static void unpinSite(ContentResolver cr, int position) {
        sDb.unpinSite(cr, position);
    } 
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:unregisterContentObserver
 
    /** 
     * Un-register ContentObservers. 
     */ 
    void stopWatching() { 
        mCr.unregisterContentObserver(mCallLogObserver);
        mCr.unregisterContentObserver(mSmsObserver);
        mCr.unregisterContentObserver(mMmsObserver);
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:unregisterContentObserver
    } 
 
    @Override 
    public void onPause() { 
        super.onPause(); 
        mContentResolver.unregisterContentObserver(simChangeObserver);
    } 
 
    private void registerSimChangeObserver() { 
        mContentResolver.registerContentObserver(
                SIM_URI, true, simChangeObserver);
    } 
 
    private void copyToPhoneMemory(Cursor cursor) {
        String address = cursor.getString(
                cursor.getColumnIndexOrThrow("address"));
        String body = cursor.getString(cursor.getColumnIndexOrThrow("body"));
        Long date = cursor.getLong(cursor.getColumnIndexOrThrow("date"));
 
        try { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:unregisterContentObserver
    protected void onDetachedFromWindow() { 
        super.onDetachedFromWindow(); 
        if (mAttached) {
            getContext().unregisterReceiver(weatherReceiver);
            mAttached = false;
            mContentResolver.unregisterContentObserver(mContentObserver);
        } 
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:unregisterContentObserver
        } 
 
        public void unobserve() { 
            ContentResolver resolver = mContext.getContentResolver();
 
            resolver.unregisterContentObserver(this);
        } 
 
        @Override 
        public void onChange(boolean selfChange, Uri uri) {
            ContentResolver resolver = mContext.getContentResolver();
            Resources res = mContext.getResources();
 
            if (uri.equals(Settings.System.getUriFor(Settings.System.NOTIFICATION_SHORTCUTS_TOGGLE))) {
                mToggle = Settings.System.getIntForUser(resolver,
                        Settings.System.NOTIFICATION_SHORTCUTS_TOGGLE, 0, UserHandle.USER_CURRENT) != 0; 
                if (mToggle) {
                    recreateShortcutLayout(); 
                } else { 
                    removeAllViews();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:unregisterContentObserver
        contentResolver.registerContentObserver(Settings.Secure.getUriFor(
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES), false, this);
    } 
 
    public void unregister(ContentResolver contentResolver) {
        contentResolver.unregisterContentObserver(this);
    } 
 
    @Override 
    public abstract void onChange(boolean selfChange, Uri uri);
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related ContentResolver unregisterContentObserver Questions & Answers:

unregisterContentObserver Method Overview
Unregisters a change observer.
See Code Examples for other Android ContentResolver Methods: