Reputation: 749
I want to add color for android calendar events, i have used the following code
ContentResolver cr = context.getContentResolver();
ContentValues values = new ContentValues();
values.put(Events.DTSTART, startMillis);
values.put(Events.DTEND, endMillis);
values.put(Events.TITLE, phNumber);
values.put(Events.DISPLAY_COLOR, 0xffff0000);
values.put(Events.CALENDAR_ID, calID);
values.put(Events.EVENT_TIMEZONE, "UTC");
Uri uri = cr.insert(Events.CONTENT_URI, values);
But this code is not added color for event. Even i'm not able to add event in calendar when i use values.put(Events.DISPLAY_COLOR, 0xffff0000) code. How can i implement Events.DISPLAY_COLOR?
Upvotes: 1
Views: 2476
Reputation: 643
Try using Events.EVENT_COLOR
instead of Events.DISPLAY_COLOR
As a reference, you can use this link to work with Calendars
Upvotes: 2