Skip to content

Instantly share code, notes, and snippets.

@mlc
Last active December 15, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlc/5188579 to your computer and use it in GitHub Desktop.
Save mlc/5188579 to your computer and use it in GitHub Desktop.
HOWTO inhibit display of the "Attending?" line in the Android calendar app when your application inserts rows into the Calendar Provider.
import android.content.ContentValues;
import android.database.Cursor;
import android.provider.CalendarContract.Calendars;
import android.provider.CalendarContract.Events;
Cursor calendarCursor;
// query the Calendars provider, and position to the desired row
long calendarId = calendarCursor.getLong(calendarCursor.getColumnIndex(Calendars._ID));
String calendarOwner = calendarCursor.getString(calendarCursor.getColumnIndex(Calendars.OWNER_ACCOUNT));
ContentValues values = new ContentValues();
// fill in the useful stuff, like DTSTART, TITLE, etc.
values.put(Events.CALENDAR_ID, calendarId);
// these two values combine to inhibit the display of the "Attending?"
// line in the Calendar app.
values.put(Events.ORGANIZER, calendarOwner);
values.put(Events.HAS_ATTENDEE_DATA, 1);
getContext().getContentResolver().insert(Events.CONTENT_URI, values);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment