While trying to read data from database, I'm getting this error:
java.lang.IllegalStateException: Couldn't read row 4, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
The number of rows in the cursor are 24, the code is giving exception at row number 22. The code I use is the following:
while (c.moveToNext()) {
SomeData someData = new SomeData();
someData.setQuestion(c.getString(0)); //Exception is coming in this line
someData.setOption1(c.getString(1));
someData.setOption2(c.getString(2));
someData.setOption3(c.getString(3));
someData.setOption4(c.getString(4));
someData.setAnswer(c.getString(5));
outMap.put(c.getString(6), someData );
}
The column value(string) for 22nd row record is 699059 characters long. I suspect that the error is a result of large String value.
Any idea how to fix this error?