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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:28:57+00:00 2026-06-15T23:28:57+00:00

I am trying to add my own calendar in android using the following code.

  • 0

I am trying to add my own calendar in android using the following code.
I have provided read write permission also in manifest.

and my error is : “Error while creating calendar the name must not be empty: null” though i have provided the name…

any one please hep me to solve it and also provide link to working solution of creating calendar in android.

                    final Uri calUri = Uri.parse("content://com.android.calendar/calendars");

                    android.accounts.Account account;
                    ContentValues vals = new ContentValues();
                    vals.put("_id", 1);

                    vals.put("_sync_account_type", "ACCOUNT_TYPE_LOCAL");
                    vals.put("name","sachin" );
                    vals.put("displayName","my_Cal");
                    vals.put("color", 14417920);
                    vals.put("access_level", 700);
                    vals.put("selected", 1);

                    vals.put("sync_events", 1);
                    vals.put("timezone", "GMT");
                    vals.put("hidden", 0);
                    Uri result=  getContentResolver().insert(calUri, vals);


                    System.out.println(result);
  • 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-15T23:28:58+00:00Added an answer on June 15, 2026 at 11:28 pm

    You should try something like this :

    vals.put(Calendar.Calendars._SYNC_ACCOUNT_TYPE, "ACCOUNT_TYPE_LOCAL");
    vals.put(Calendar.Calendars.NAME,"sachin");
    vals.put(Calendar.Calendars.DISPLAY_NAME,"my_Cal");
    vals.put(Calendar.Calendars.COLOR, 14417920);
    vals.put(Calendar.Calendars.ACCESS_LEVEL, 700);
    vals.put(Calendar.Calendars.SELECTED, 1);
    vals.put(Calendar.Calendars.SYNC_EVENTS, 1);
    vals.put((Calendar.Calendars.TIMEZONE, "GMT");
    vals.put(Calendar.Calendars.HIDDEN, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SilverStripe 2.4.7 with DataObjectManager. I'm trying to add in my own
I'm trying to add iCloud support to my application, and have been following Apple's
I have been trying to add click events to a series of divs using
I have been trying to add a .cu file into my own(dll) win32 project
I have made my own drop down here: http://jsfiddle.net/Hunter4854/GJVjT/ I am trying to add
I am trying to add multiple markers each with its own infowindow that comes
I am trying to simply add a Google Search bar onto my own map
I am trying add picture boxes dynamically. My code is as PictureBox picture =
When creating my own macro, and trying to add it so that anyone can
I am currently trying to add a widget to my application and have been

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.