public void buildCapsuleInsert(Capsule capsule, boolean withYield) { // Build the INSERT operation ContentProviderOperation.Builder builder = ContentProviderOperation.newInsert(CapsuleContract.Capsules.CONTENT_URI); builder.withValues(Capsules.buildContentValues(capsule)); builder.withYieldAllowed(withYield); // Add it to the collection this.mOperations.add(builder.build()); }
public void buildCapsuleUpdate(Capsule capsule, boolean withYield) { // URI for updating a Capsule Uri uri = ContentUris.withAppendedId(CapsuleContract.Capsules.CONTENT_URI, capsule.getId()); // Build the UPDATE operation ContentProviderOperation.Builder builder = ContentProviderOperation.newUpdate(uri); builder.withValues(Capsules.buildContentValues(capsule)); builder.withYieldAllowed(withYield); // Add it to the collection this.mOperations.add(builder.build()); }