Retrieve the default calendar id in Android

前端 未结 5 688
走了就别回头了
走了就别回头了 2021-01-04 02:51

I have the following code for adding event to calendar.

The problem is that I don\'t know how to retrieve the default calendar id.

l         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 03:27

    There's a IS_PRIMARY column in CalendarContract.CalendarColumns. You query with selection:

    CalendarContract.CalendarColumns.IS_PRIMARY + "=1"
    

    However, this is since SDK 17

提交回复
热议问题