I'm trying to debug an issue myself. May post it later if I fail ;-)
My logcat log states "android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 2"
I would like to use log.v("desc", cursor)
to show what the cursor returns. Is there a way to specify a value from it like cursor[0] ?
Android has provided a specific class just for debugging Cursors. It is called DatabaseUtils.
Call the method dumpCursorToString() 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.
use this before cursor.moveToFirst()
Log.v("Cursor Object", DatabaseUtils.dumpCursorToString(cursor))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With