ContentProvider applyBatch - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:applyBatch
	protected abstract Uri entriesURI();
	public abstract void clearDirty(Resource resource);
	 
	public void commit() throws RemoteException, OperationApplicationException { 
		if (!pendingOperations.isEmpty())
			providerClient.applyBatch(pendingOperations);
		pendingOperations.clear();
	} 
} 
5
CodeRank
This code example shows how to use the following methods:applyBatch
	} 
 
	@Override 
	public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations) {
		try { 
			return mProvider.applyBatch(operations);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (OperationApplicationException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
		return null; 
	} 
 
	public void addToContentResolver(MockContentResolver resolver) {
		resolver.addProvider(DbContract.CONTENT_AUTHORITY, this);
	} 
} 
5
CodeRank
This code example shows how to use the following methods:applyBatch
		} 
 
		public void applyChanges() { 
			try { 
				Log.v(TAG, "Applying " + mBatch.size() + " operations to contacts DB...");
				mProvider.applyBatch(mBatch); 
				mBatch.clear(); 
			} catch (RemoteException e) {
				Log.e(TAG, "Could not sync contacts", e);
				mSyncResult.databaseError = true; 
			} catch (OperationApplicationException e) {
				Log.e(TAG, "Could not sync contact", e);
				mSyncResult.databaseError = true; 
			} 
		} 
	} 
	 
	public LDAPSyncAdapter(Context ctx)
	{ 
		super(ctx, true);
4
CodeRank
This code example shows how to use the following methods:applyBatch
    ContentProviderClientWrapper(ContentProviderClient underlying) {
        mUnderlying = underlying;
    } 
 
    public final ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations) throws RemoteException, OperationApplicationException {
        return mUnderlying.applyBatch(operations);
    } 
 
    public final int bulkInsert(Uri url, ContentValues[] initialValues) throws RemoteException {
        return mUnderlying.bulkInsert(url, initialValues);
    } 
 
    //    @TargetApi(17) 
    //    public final Bundle call(String method, String arg, Bundle extras) throws RemoteException { 
    //        return mUnderlying.call(method, arg, extras); 
    //    } 
 
    public final int delete(Uri url, String selection, String[] selectionArgs) throws RemoteException {
        return mUnderlying.delete(url, selection, selectionArgs);
    } 
4
CodeRank
This code example shows how to use the following methods:applyBatch
        ops.add(op.build());
    } 
 
    public void apply(ContentProviderClient provider)
            throws OperationApplicationException, RemoteException { 
        provider.applyBatch(ops);
        ops.clear();
    } 
 
    private Uri syncUri(Uri uri) {
        return uri.buildUpon().appendQueryParameter(ContactsContract.CALLER_IS_SYNCADAPTER, "true")
                .build();
    } 
} 
4
CodeRank
This code example shows how to use the following methods:applyBatch
applyBatch Method Overview
Override this to handle requests to perform a batch of operations, or the default implementation will iterate over the operations and call apply(ContentProvider, ContentProviderResult[], int) on each of them.
See Code Examples for other Android ContentProvider Methods: