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 8969759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:38:18+00:00 2026-06-15T17:38:18+00:00

When I update the CalendarContract.Events DTEND column, why doesn’t the change show up in

  • 0

When I update the CalendarContract.Events DTEND column, why doesn’t the change show up in the CalendarContract.Instances END column?

My app allows the user to view and change calendar events using the CalendarContract.Events APIs. The code performs an update to the Events table and then reads it back (later) using the Instances table. Changes to TITLE, for example, work fine (that is, I update Events and can read back the change in Instances). Changes to Events.DTEND do show up in Instances.DTEND, but how can I get that update to also show up in Instances.END?

This is important since, evidently, the Android calendar app (and my app, too) uses Instances.BEGIN and Instances.END to determine what to display in the calendar.

Here is my update code:

  ContentResolver cr = getContentResolver();
  ContentValues values = new ContentValues();
  values.put (Events.CALENDAR_ID, calendarId);
  values.put (Events.TITLE, title);
  values.put (Events.DTEND, eventEnd.getTimeInMillis());
  String where = "_id =" + eventId +
                 " and " + CALENDAR_ID + "=" + calendarId;
  int count = cr.update (Events.CONTENT_URI, values, where, null);
  if (count != 1)
     throw new IllegalStateException ("more than one row updated");

Thanks.

  • 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-06-15T17:38:19+00:00Added an answer on June 15, 2026 at 5:38 pm

    The solution turns out to be adding the start date:

      ContentResolver cr = getContentResolver();
      ContentValues values = new ContentValues();
      values.put (Events.CALENDAR_ID, calendarId);
      values.put (Events.TITLE, title);
      values.put (Events.DTSTART, eventStart.getTimeInMillis());
      values.put (Events.DTEND, eventEnd.getTimeInMillis());
      String where = "_id =" + eventId +
                     " and " + CALENDAR_ID + "=" + calendarId;
      int count = cr.update (Events.CONTENT_URI, values, where, null);
      if (count != 1)
         throw new IllegalStateException ("more than one row updated");
    

    A word of caution: this case only shows how to update nonrecurring events. Nonrecurring events have a null RRULE.

    I suspect what the provider code is doing is using only the values you provide instead of refetching the start date itself (obviously if the user changes the start date you would have to provide it anyway). This makes sense from the perspective of reducing db accesses. Too bad Google didn’t document any of this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE : A commenter told me to change some codes, this is the new
Update : answer on how to draw one using Superformula is at the end
Update.. code works now had to change the validation statement on form submit. Removed
Update: As of jQuery 1.4, $.live() now supports focusin and focusout events. jQuery currently
Update: Is there a way to achieve what I'm trying to do in an
update: I mistyped 2 variables...so embarrassing. thanks everyone for the effort! sorry i find
Update: I reported this as a bug to Apple and they fixed it! All
UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
Update : This is no longer an issue from C# 6, which has introduced
UPDATE UPI_ATTRIBUTE SET SITE_INC ='0' WHERE USER_PROFILING_NAME IN ('CAR_IMPLICIT','CAR_EXPLICIT') Above is my query that

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.