简体   繁体   中英

Android SDK: How to get out of office status for Calendar events?

Galaxy S3, ICS, Java: For upcoming CalendarContract Events how can I determine whether the Event will be Out of Office, such as an upcoming vacation? Using CalendarContract.Events I can successfully read calendar event information, including the AVAILABILITY (BUSY, FREE, TENTATIVE). My phone shows upcoming vacation as Out of Office so I expected to find a way to retrieve that status for Events but so far no luck.

As a workaround to your road block, you could try comparing the location of events. Either have the user set their work location, or read it from an in office event. Then everything with a location != office location you can display as out of office.

It seems that with current Android SDK (Level 29) the Calendar provider does not reveal this information. According to the docs :

AVAILABILITY (added in API level 14)

If this event counts as busy time or is still free time that can be scheduled over. Column name.

Type: INTEGER (One of AVAILABILITY_BUSY, AVAILABILITY_FREE, AVAILABILITY_TENTATIVE)

However, as there exists calendar apps that correctly show out-of-office as the busy status, I assume that these implement their own calendar syncing and do not rely on the Android Calendar Provider .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM