SQLite transactions with Google IO REST pattern's ContentProvider?

 ̄綄美尐妖づ 提交于 2019-12-04 07:28:24

Since you don't have access to the the Level 11 API, you could do this instead. Lets say you want to do this transaction stuff in your update method:

final Cursor update(Uri uri, ContentValues values, String where, String[] selectionArgs)
{

   if(uri == uri1){
     //do stuff you normally do
   }
   //other uri stuff
   ...
   else if(uri == special_uri){
     //do your transaction stuff here
   }
}

In this case, special_uri is a uri you use to indicate that you're going to need to do your special transaction stuff. In other words, we're using the URI here to indicate that a transaction must be done.

You can implement custom function in your ContentProvider that execute your necessary transactions. Then you can call those funcitons using the call() function in your Processor.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!