Android - Can you update a Cursor for SQLite results?

后端 未结 3 1235
生来不讨喜
生来不讨喜 2020-12-20 15:57

One of my methods returns a Cursor from some SQLite query results.

As I\'m navigating through the cursor, there are some records I want to change/update. Can I updat

3条回答
  •  盖世英雄少女心
    2020-12-20 16:22

    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.

提交回复
热议问题