Is SQLite cursor.getCount expensive operation in Android

前端 未结 1 1787
感情败类
感情败类 2020-12-10 10:48

Is SQLite cursor.getCount() expensive operation when executed on Android device?

Which is faster:

Cursor cursor = d         


        
相关标签:
1条回答
  • 2020-12-10 11:24

    If you compare the time required for both code samples to execute, you'll notice it's the same because Cursor.moveToFirst() is eventually calling SQLiteCursor.getCount()

    0 讨论(0)
提交回复
热议问题