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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:52:59+00:00 2026-05-31T01:52:59+00:00

I’m making a back-end function for another area of a program that will add

  • 0

I’m making a back-end function for another area of a program that will add events to the user’s calendar. Basically someone will pick an event out from options in a GUI and I want to set an event on the calendar that matches the choice.
The code to make it more clear what I’m working with:

    java.sql.Timestamp tsStart = java.sql.Timestamp.valueOf(year + "-" + month + "-" + day + " " + startHour + ":" + startMinute + ":00");
    java.sql.Timestamp tsEnd = java.sql.Timestamp.valueOf(year + "-" + month + "-" + day + " " + endHour + ":" + endMinute + ":00");        

    long startTime = tsStart.getTime();
    long endTime = tsEnd.getTime();

    Intent intent = new Intent(Intent.ACTION_EDIT);
    intent.setType("vnd.android.cursor.item/event");        
    intent.putExtra("beginTime", startTime);     
    intent.putExtra("allDay", false);
    intent.putExtra("rrule", "FREQ=WEEKLY;COUNT="+numWeeks);
    intent.putExtra("endTime", endTime);
    intent.putExtra("title", title);
    intent.putExtra("description", description);
    intent.putExtra("eventLocation", location);
    startActivity(intent);

I’ve been using intent to go about doing this, but there are a few extras that I’d rather not have:
1. When the intent launches, it starts in the text entry for the What field. I’ve automatically filled all of these fields, so the user shouldn’t need to do anything, and when it launches like this, the keyboard takes up a lot of space and looks messy. Is there any way I can either set the focus not to be in the textbox or to fake a back button press?
2. Is it possible to make some of the sections of the intent not show? I don’t think it’s necessary to ask the time zone, don’t need the all day check (because I tell it the start and end time), don’t need Guests, would rather hide the repetition because it’s customized and might confuse the end user to see, and I DO NOT want reminders, which it automatically makes one for 10 minutes.
-> Is it possible to hide any/all of those items?
3. Is it possible to even make this never display to the user? I like the fact that it allows the user to pick which calendar to use, but I’m fine with it using their default since most people link their phone with their other accounts, and the phone calendar is my main focus. If I can make the 10 minute reminder go away, I would to just make it never display to the user and have it just populate their calendar as I tell it to.

Thanks to anyone who can give any help. I’ve been reading over intents, calendars, and anything I could think of over at Android Developers, and I’ve hit a wall that I can’t find these answers. Which reminds me, is there a listing anywhere of all of the valid putExtra’s? The Android Developers page was good for listing all of the methods, etc, but aside from finding some examples, I don’t know what all I can put as valid arguments inside the putExtra.

  • 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-31T01:53:00+00:00Added an answer on May 31, 2026 at 1:53 am

    When you send an intent to add an event to the Calendar, you’re launching the Calendar activity. Intents are simply a message out to the system; any activity that can handle the intent is free to “speak up”. If more than one activity’s intent filter matches the intent, the user sees a “disambiguation” screen, which allows him or her to choose the app to use. In the case of most Intents, it’s the MIME type that determines which app(s) are displayed. You could write your own activity for handling events, if you wanted. The activity’s intent filter would have to match the Calendar’s, and I wouldn’t recommend doing this since you’re signing yourself up for handling every intent that tries to add something to the calendar!

    You have the choice of sending an intent to the Calendar Provider (actually the Calendar app, which accesses the provider) or inserting the data yourself using the ContentResolver API with the Calendar Provider.

    You might consider the latter course of action, and provide your own UI instead of using the Calendar activity, but I advise you to use caution in adding recurring events, because getting them right is tricky. In general, developers should use the Calendar activity to allow users to add events.

    If you use the Intent to start the Calendar “insert event” activity, you have no control over its UI. As a convenience, the Calendar activity will populate the UI with the Extras you send. If you don’t send an Extra, the activity will either populate the field with the default or leave it blank. I’m not certain that it does, but this is standard practice.

    Developers often overlook the Developer guides when they develop apps. Take a look at
    http://developer.android.com/guide/topics/providers/calendar-provider.html#intents, which describes the Calendar Provider in detail. This page lists all the available Extras, tells you how to use the ContentResolver() process for inserting events, and elaborates on using Intents.

    At the moment, I don’t think there’s a standard way for an application to expose the structure of the Intents it handles, but for the built-in or bundled apps that appear in on a device, you can always just ask here for more information. Remember that some apps are bundled with the platform, but others (such as Google Maps) are separate. They may have public intents/APIs, but you need to be aware that they may not be available for a particular user’s device.

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

Sidebar

Related Questions

I need a function that will clean a strings' special characters. I do NOT
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I need to clean up various Word 'smart' characters in user input, including but

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.