2

When I get Cursor object from ContentProvider, at that time, I can use this cursor object to retrieve all data. My question is:

  1. Does cursor contains all data inside. It means system has queried and cost a time for loading data.

  2. This is just laziness loading. It means when you start to get data from cursor, that time system try to get data from database layer. If this true, how many data that Cursor has loaded first, or no data at all ?

Thanks :)

Trần Kim Dự
  • 5,872
  • 12
  • 55
  • 107
  • ContentProvider provides the Cursor ... and that's it ... now dependt on Cursor implementation (and usage - fx for IPC curosr it may be different) iteration of the Cursor itself may be "laziness" fx: `SQLiteCursor`- `AbstractWindowedCursor.fillWindow` – Selvin Jan 25 '16 at 16:21
  • 1
    Possible duplicate of [Does Android SQLite cursor load all records into memory at once?](http://stackoverflow.com/questions/31465069/does-android-sqlite-cursor-load-all-records-into-memory-at-once) – starkshang Jan 25 '16 at 16:34

1 Answers1

1

Your question may be answered already in this question. Also, this link may be helpful for you.

Community
  • 1
  • 1
h2nghia
  • 432
  • 5
  • 15