我正在读取来自Android日历的一些数据,有时候用户会报告一些奇怪的崩溃,例如:
java.lang.IllegalStateException: Couldn't read row 384, col 47 from CursorWindow.
Make sure the Cursor is initialized correctly before accessing data from it.
这是我的代码(粗体字是应用程序崩溃的行):
Cursor eventCursor = contentResolver.query
(builder.build(),
null,
CalendarContract.Instances.CALENDAR_ID + " IN (" + ids + ")",
null,
null);
if (eventCursor == null)
return true;
while (eventCursor.moveToNext()) { //this line causecrash
... do something...
}
为什么会发生这种情况?它无法模拟。我从未遇到过这种情况,也无法理解错误的原因和提示信息。