0

我正在关注以下链接 http://lovingandroid.blogspot.com/2011/08/retrieving-events-from-calendar.html 但在calCursor.moveToFirst(); 我正在使用模拟器时遇到异常,这是什么解决方案???

4

2 回答 2

1

也许你的光标没有数据

使用喜欢

    if(calCursor.getCount()>0)
    calCursor.moveToFirst();
于 2011-08-09T11:11:03.603 回答
0

你得到了什么例外?是空指针异常吗?如果是,您可能需要在调用其 moveToFirst() 方法之前先检查 calCursor 是否为空。

于 2012-05-01T15:13:55.427 回答