Code example for ContentResolver

Methods: registerContentObserver

0
            // The callback will clear the cache to force the resolver to be consulted 
            // on future gets. The version is also updated. 
            new Thread() {
                public void run() { 
                    Looper.prepare();
                    cr.registerContentObserver(CONTENT_URI, true,
                        new ContentObserver(new Handler(Looper.myLooper())) {
                            public void onChange(boolean selfChange) {
                                synchronized (Gservices.class) { 
                                    sCache.clear();
                                    sVersionToken = new Object();
                                } 
                            } }); 
                    Looper.loop();
                } 
            }.start();
        } 
    } 
 
    /** 
     * Look up a key in the database.