Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:21:18+00:00 2026-05-27T17:21:18+00:00

In android we insert an event programmatically through intent. we insert title, description and

  • 0

In android we insert an event programmatically through intent. we insert title, description and time . But there is no key found to insert attendee mail id and recipient mail id into a calendar event. If it is impossible, Why is this not possible & If Possible , How do i achieve it?

Brief Explanation of question:
How to pass the mail id of the calendar that to be synchronized into the create event through email?
I have a spinner that shows the list of accounts to be synchronized . Now, as usual passing title,description to create event in calendar application, i use following code.

ContentValues values = new ContentValues();
    values.put("calendar_id", 1);
    values.put("title", title1);
    values.put("allDay", 0);
    values.put("dtstart", settime); // event starts at 11 minutes from now
    values.put("dtend", cal.getTimeInMillis()+60*60*1000); // ends 60 minutes from now
    values.put("description", desc1);
    values.put("???????", mail_id);
    values.put("???????", participant_mail_id);
    values.put("visibility", 0);
    values.put("hasAlarm", 1);
    event = cr.insert(EVENTS_URI, values);

What should i use to pass the key to insert email id and participant id? Any Help is really appreciated. My screen shot goes below.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:21:19+00:00Added an answer on May 27, 2026 at 5:21 pm

    Calendar Provider is public since ICS (API Level – 14). More info here

    To add attendees you need the event id, so you need to add event first.

    Example for API level >=14:

    ContentResolver cr = getContentResolver();
    
    // add event
    ContentValues values = new ContentValues();
    values.put(Events.DTSTART, startMillis);
    values.put(Events.DTEND, endMillis);
    values.put(Events.TITLE, "Jazzercise");
    values.put(Events.DESCRIPTION, "Group workout");
    values.put(Events.CALENDAR_ID, calID);
    values.put(Events.EVENT_TIMEZONE, "America/Los_Angeles");
    Uri uri = cr.insert(Events.CONTENT_URI, values);
    
    // get the event ID that is the last element in the Uri
    long eventID = Long.parseLong(uri.getLastPathSegment());
    
    // add attendee
    values = new ContentValues();
    values.put(Attendees.ATTENDEE_NAME, "Trevor");
    values.put(Attendees.ATTENDEE_EMAIL, "trevor@example.com");
    values.put(Attendees.ATTENDEE_RELATIONSHIP, Attendees.RELATIONSHIP_ATTENDEE);
    values.put(Attendees.ATTENDEE_TYPE, Attendees.TYPE_OPTIONAL);
    values.put(Attendees.ATTENDEE_STATUS, Attendees.ATTENDEE_STATUS_INVITED);
    values.put(Attendees.EVENT_ID, eventID);
    cr.insert(Attendees.CONTENT_URI, values);
    

    Example for API level < 14:

    String calendarLocation;
    // set calendar URI (depends on api level)
    if (Build.VERSION.SDK_INT >= 8) {
        calendarLocation = "content://com.android.calendar/"; 
    } else {
        calendarLocation = "content://calendar/";
    }
    
    // URIs for events and attendees tables
    Uri EVENTS_URI = Uri.parse(calendarLocation + "events");
    Uri ATTENDEES_URI = Uri.parse(calendarLocation + "attendees");
    
    ContentResolver cr = getContentResolver();
    
    // add event
    ContentValues values = new ContentValues();
    values.put("dtstart", startMillis);
    values.put("dtend", endMillis);
    values.put("title", "Jazzercise");
    values.put("description", "Group workout");
    values.put("calendar_id", calID);
    values.put("eventTimezone", "America/Los_Angeles");
    Uri uri = cr.insert(EVENTS_URI, values);
    
    // get the event ID that is the last element in the Uri
    long eventID = Long.parseLong(uri.getLastPathSegment());
    
    // add attendee
    values = new ContentValues();
    values.put("attendeeName", "Trevor");
    values.put("attendeeEmail", "trevor@example.com");
    values.put("attendeeRelationship", 1);
    values.put("attendeeType", 2);
    values.put("attendeeStatus", 3);
    values.put("event_id", eventID);
    cr.insert(ATTENDEES_URI, values);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Android is there an easy way to insert commas into a numberical value?
I'm trying the Facebook Android SDK, but I don't know where to insert my
Is there support for transactions in SQLite for android ? I need to insert
My Android application uses Java OAuth library, found here for authorization on Twitter. I
I'm using the insertWithOnConflict function in Android/SQLite to insert values that potentially already exist
I found some tutorials to use the camera. There are no errors on the
I want to bulk insert about 700 records into the Android database on my
I am new to Android and Eclipse development, but not new to software development
How does Android's SQLite library resolve conflicts if I insert duplicate rows? I am
android allows me to launch an intent to create a new contact. i can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.