robotoworks / mechanoid

Eclipse plugin providing a set of DSL's for the rapid development of Android apps
58 stars 26 forks source link

update with ContentProviderOperation for faster performance #261

Closed hannesa2 closed 6 years ago

hannesa2 commented 9 years ago

I want to update a lot of records, that's why I try to use .applyBatch()

For example with normal updates

Recipes.newBuilder()
.setTitle("Omelette")
.update(123);

but how to to it with ContentProviderOperation and specify by ID ?

Builder updOP =Recipes.newBuilder()
.setTitle("Omelette")
.toUpdateOperationBuilder();
ops.add(updOP.build());
...
context.getContentResolver().applyBatch(uri.getAuthority(), ops);

Thank you !