查询Calendar API时出错?

时间:2011-11-04 21:35:47

标签: android calendar

有一些新的API添加了冰淇淋 - 三明治释放。我试图从日历APi获取持续时间详细信息。

我使用了以下代码

Cursor cursorEvent = CalendarContract.EventDays.query(getContentResolver(),1,1, null);

但我得到以下SQLite异常。

  

11-04 20:49:14.918:E / AndroidRuntime(10135):引起:   android.database.sqlite.SQLiteException:没有这样的列:selected :,   编译时:SELECT eventEndTimezone,visible,rrule,hasAlarm,   rdate,dtstart,hasAttendeeData,calendar_timezone,startDay,   description,calendar_access_level,account_type,   hasExtendedProperties,eventLocation,dtend,allDay,organizer,   Events.deleted as deleted,account_name,originalInstanceTime,   selfAttendeeStatus,eventTimezone,ownerAccount,endDay,   canOrganizerRespond,endMinute,Instances.event_id AS event_id,   lastDate,canModifyTimeZone,guestsCanModify,exrule,   guestsCanSeeGuests,title,Instances._id AS _id,_sync_id,   allowedReminders,end,availability,startMinute,calendar_id,   original_id,originalAllDay,maxReminders,accessLevel,begin,   calendar_color,duration,calendar_displayName,original_sync_id,   guestsCanInviteOthers,eventColor,exdate,eventStatus FROM Instances   INNER JOIN view_events AS事件ON(Instances.event_id = Events._id)   WHERE(startDay< =?AND endDay> =?)AND(selected = 1)GROUP BY startDay

任何人都可以帮我解决这个问题。提前谢谢。

1 个答案:

答案 0 :(得分:0)

可能为时已晚,但我认为该列的名称在SDK v.14中是“可见的”(之前是“选中”): http://developer.android.com/reference/android/provider/CalendarContract.CalendarColumns.html#VISIBLE