Viewing an Android database cursor

Android has provided a specific class just for debugging Cursors. It is called DatabaseUtils.

Call the method DatabaseUtils.dumpCursorToString(cursor) to view the contents of your cursor.

This helper loops through and prints out the content of the Cursor for you, and returns the cursor to its original position so that it doesn’t mess up your iterating logic.

Leave a Comment