Last active
December 15, 2015 02:39
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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