多行插入带的ContentProviderContentProvider

2023-09-05 00:43:09 作者:山楂味的诗

我需要做的几行插入在一个事务中。我可以做它的ContentProvider?

I need to make insert of few rows in one transaction. Can I do it with ContentProvider?

推荐答案

在客户端, ContentResolver的支持 bulkInsert()方法。这些不一定会在一个事务中的的ContentProvider ,只是因为有可能不被执行的任何交易的ContentProvider 。

On the client side, ContentResolver supports a bulkInsert() method. Those will not necessarily be processed in a single transaction by the ContentProvider, simply because there may not be any transactions performed by the ContentProvider.