Android - Can you update a Cursor for SQLite results?

半世苍凉 提交于 2019-11-29 14:08:05

You can not directly update records with the cursor. Read the Android Cursor doc.

You need to implement a Content Provider that allows to update the record, in short you need to override the update function in your ContentProvider class.

public int update(Uri uri, ContentValues values, String where, String[] whereArgs)

In short you'll have to update them, this is not done directly from the data received in the Cursor.

This and this link should help.

To do that the best way is to implement a content provider for your data http://developer.android.com/guide/topics/providers/content-providers.html

You can use framework like datadroid for that http://datadroid.foxykeep.com/

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