如何从sqlite db加载超过1 MB的数据到android游标?

时间:2011-08-04 08:34:52

标签: android sqlite android-cursor

我正在尝试从sqlite数据库加载超过1MB的数据到android游标。在加载时,它会出现以下错误,如

08-04 11:10:15.813: ERROR/CursorWindow(4465): need to grow: mSize = 2097152, size = 403719, freeSpace() = 209669, numRows = 1
08-04 11:10:15.813: ERROR/CursorWindow(4465): Attempting to grow window beyond max size (2097152)
08-04 11:10:15.813: ERROR/Cursor(4465): Failed allocating 403719 bytes for blob at 0,13
08-04 11:10:15.813: DEBUG/Cursor(4465): finish_program_and_get_row_count row 0
08-04 11:10:15.899: ERROR/CursorWindow(4465): need to grow: mSize = 2097152, size = 403719, freeSpace() = 209669, numRows = 1
08-04 11:10:15.899: ERROR/CursorWindow(4465): Attempting to grow window beyond max size (2097152)
08-04 11:10:15.899: ERROR/Cursor(4465): Failed allocating 403719 bytes for blob at 0,13
08-04 11:10:15.899: DEBUG/Cursor(4465): finish_program_and_get_row_count row 0
08-04 11:10:15.899: ERROR/CursorWindow(4465): Bad request for field slot 0,0. numRows = 0, numColumns = 14
08-04 11:10:15.899: DEBUG/AndroidRuntime(4465): Shutting down VM.

如果有人知道如何将大数据(超过1MB)加载到android游标? 感谢,

1 个答案:

答案 0 :(得分:6)

不要在数据库中存储500KB的blob。将标识符存储在数据库中,并将blob作为文件放入存储中。如果您使用MODE_PRIVATE,其他进程将无法访问它们。