简体   繁体   中英

How to create a event in android calendar for custom account?

I want to add my own server calendar events to android. I already done contact synchronization from my custom account.

But I cannot find code for create a event in calendar for my custom account.

any source code or links welcome.

you have to create the event and add it to the calendar with the

 ContentValues values = new ContentValues();
 values.put(some parameter..., value);

 contentResolver.insert(CalendarContract.events, values );

The key of the thing is that you have to bind your event to the calendar by the ID of the calendar. So one of the parameter should be look like this in values.put()

 values.put(Events.CALENDAR_ID, calID);

Tutorial on this site Add event to calendar

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