我在 Cursor
上遇到了一个名为 moveToPrevious()
的方法.
我之前读过一篇 article这表明实现 C SQLite step command 的向后版本很难/不可能:
... asking for an sqlite3_step_backward() button is really like expecting your symbolic debugger to be able to run backwards or to "undo" its execution back to the previous breakpoint. Nobody reasonably expects debuggers to be able to do this, so you shouldn't expect SQLite to be able to sqlite3_step_backward() either.
- Android 游标是 SQLite 的包装器还是某种独立实现?
- 他们是如何做出这个 moveToPrevious 命令的?
最佳答案
Android Cursor
类确实会先将所有结果记录读入内存,然后让您随机遍历它们。
(这就是游标中的数据有 1 MB 限制的原因。)
关于android - Java是如何实现Cursor上的moveToPrevious方法的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17408836/