Make Sure The Cursor Is Initialized Correctly Before Accessing Data From It
Solution 1:
In my case it was because I didn't include the column in the projection passed into the CursorLoader constructor. Which means I was trying to access data from a column that didn't exist in the cursor that was returned.
I hope this helps somebody...
Solution 2:
I have encountered this same exception before. In my case the cause was a database cell containing too much data (a huge string). Judging from the code (COLUMN_FACEBOOK_BIG_IMAGE) I guess that you have encountered the same problem. For the solution was to check the size of the strings that were put into the DB (and down scaling the image when needed). Hope this helps!
Solution 3:
Maybe you are using your old database. If you changed some tables, fields on your database and you are now trying on another device (which is you already installed your application before database changes), you should only delete your old database and create new file.
Solution 4:
Try calling cursor.moveToFirst ()
before using the cursor. Let me know if that worked.
Solution 5:
You should fix this to solve the following error message
Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
It works in my code.
Try to position cursor by
moveToFirst
before reading data from it.Check for null->
if (c != null && c.moveToFirst()) {}
Check for count->
(c != null && c.getCount() >0 && c.moveToFirst()){}
Post a Comment for "Make Sure The Cursor Is Initialized Correctly Before Accessing Data From It"