Iterate Android Cursor

August 15, 2017
The simplest way to loop cursor.

There are many ways to do it, I think the following is the simplest and cleanest.

// move cursor to before 1st, just in case
cursor.moveToPosition(-1);
while (cursor.moveToNext()) {
  ...
}
cursor.close();

References:

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.