[android-developers] Why first call to Cursor.getCount() is so slow?

2009-12-15 Thread Andriy Tsykholyas
Hi, I've noticed quite a strange thing with Cursor object. If I use my own database (with SQLiteDatabase and SQLiteOpenHelper) and run some query on it (using any of SQLiteDatabase query() methods) this query is finished very quickly, in a few milliseconds. But then first call to some of Cursor

Re: [android-developers] Why first call to Cursor.getCount() is so slow?

2009-12-15 Thread Romain Guy
Hi, The query doesn't actually do much. The Cursor is lazily loaded so it's only the first method call to access data (like getCount()) that loads the content of the rows. On the other hand if I query some ContentProvider (using getContext ().getContentResolver().query()) then this query takes