Code example for ContentProviderClient

Methods: query

0
         * @throws RemoteException if there is a failure communicating with the remote 
         * {@link android.content.ContentProvider} 
         */ 
        public static byte[] get(ContentProviderClient provider, Uri uri,
                Account account) throws RemoteException {
            Cursor c = provider.query(uri, DATA_PROJECTION, SELECT_BY_ACCOUNT,
                    new String[]{account.name, account.type}, null);
            try { 
                if (c.moveToNext()) {
                    return c.getBlob(c.getColumnIndexOrThrow(Columns.DATA));
                } 
            } finally { 
                c.close();
            } 
            return null; 
        } 
 
        /** 
         * Assigns the data array as the sync state for the given account. 
         * @param provider the {@link ContentProviderClient} that is to be used to communicate 
         * with the {@link android.content.ContentProvider} that contains the sync state.