Getting rid of "Attending?" in Android calendar event, using the Calendar API -
i'm creating local calendar on android device, , inserting events this. here code (using dummy data now):
public static uri createcalendarwithname(context ctx, string calendarname, string displayname, account account) { uri target = uri.parse(calendarcontract.calendars.content_uri.tostring()); target = target.buildupon().appendqueryparameter(calendarcontract.caller_is_syncadapter, "true") .appendqueryparameter(calendarcontract.calendars.account_name, account.name) .appendqueryparameter(calendarcontract.calendars.account_type, account.type).build(); contentvalues values = new contentvalues(); values.put(calendars.account_name, account.name); values.put(calendars.account_type, account.type); values.put(calendars.name, calendarname); values.put(calendars.calendar_display_name, displayname); values.put(calendars.calendar_color, calendar_color); values.put(calendars.calendar_access_level, calendarcontract.calendars.cal_access_owner); values.put(calendars.owner_account, account.name); values.put(calendars.visible, 1); values.put(calendars.sync_events, 1); values.put(calendars.calendar_time_zone, "europe/oslo"); //values.put(calendars.allowed_attendee_types, "0"); uri newcalendar = ctx.getcontentresolver().insert(target, values); return newcalendar; } public void addeventtocalendar(){ long calid = getlocalcalid(); long startmillis = 0; long endmillis = 0; calendar begintime = calendar.getinstance(); begintime.set(2013, calendar.may, 5, 14, 30); startmillis = begintime.gettimeinmillis(); calendar endtime = calendar.getinstance(); endtime.set(2013, calendar.may, 5, 14, 55); endmillis = endtime.gettimeinmillis(); contentresolver cr = getcontentresolver(); contentvalues values = new contentvalues(); values.put(events.dtstart, startmillis); values.put(events.dtend, endmillis); values.put(events.title, "siste frist å ettersende papirer"); values.put(events.description, "hei!\n\n"); values.put(events.calendar_id, calid); values.put(events.event_timezone, "europe/oslo"); uri uri = cr.insert(events.content_uri, values); // event id last element in uri long eventid = long.parselong(uri.getlastpathsegment()); log.i("eventid", ""+eventid); cr = getcontentresolver(); values = new contentvalues(); values.put(reminders.minutes, timeunit.minutes.convert(2, timeunit.days)); values.put(reminders.event_id, eventid); values.put(reminders.method, reminders.method_alert); uri = cr.insert(reminders.content_uri, values); }
the calendar , event created intended, opening event reveals row named "attending", 3 radio buttons: "yes, maybe , no".
are there way of getting rid of row/radio buttons? choice anyhow not have effect ever in event in local calendar, presume...
i'm using android 4.0.4 device btw :)
adding both these lines seem solve problem:
values.put(events.organizer, calendarowner); values.put(events.has_attendee_data, 1);
not quite sure why!
Comments
Post a Comment