Code example for ContentProviderClient

Methods: getLocalContentProvider, release

0
        @Override 
        protected Void doInBackground(CellBroadcastOperation... params) {
            ContentProviderClient cpc = mContentResolver.acquireContentProviderClient(
                    CellBroadcastContentProvider.CB_AUTHORITY);
            CellBroadcastContentProvider provider = (CellBroadcastContentProvider)
                    cpc.getLocalContentProvider();
 
            if (provider != null) {
                try { 
                    boolean changed = params[0].execute(provider);
                    if (changed) {
                        Log.d(TAG, "database changed: notifying observers...");
                        mContentResolver.notifyChange(CONTENT_URI, null, false);
                    } 
                } finally { 
                    cpc.release();
                } 
            } else { 
                Log.e(TAG, "getLocalContentProvider() returned null");
            }