For example, the following intent call supplies some title and description information about an event: Intent calIntent = new Intent(Intent.ACTION_INSERT) ĬtType("/event") ĬalIntent.putExtra(Events.TITLE, "My House Party") ĬalIntent.putExtra(Events.EVENT_LOCATION, "My Beach House") ĬalIntent.putExtra(Events.DESCRIPTION, "A Pig Roast on the Beach") The typical calendar event settings are all available as Extras. Extras can be used to describe event details, the date and time of the event, as well as calendar event settings like whether the event can be seen by others and whether it is busy or available time. You can seed the information associated with a calendar event by supplying a number of intent extras. It does not set any of the calendar data associated with the event. The intent to create a calendar event is shown below: Intent calIntent = new Intent(Intent.ACTION_INSERT) ĬtData(_URI) The user must confirm this event and can add or change any of the event data associated with the event. This intent will launch the Calendar application with a screen that allows them to create a new event. In order to prompt the user to create a calendar event in their existing calendar, you’ll need to create the appropriate intent. It also assumes that you’ve properly configured the Calendar application on the Android emulator (or a suitable device, when one becomes available in the coming weeks). This tutorial assumes you have a project that supports Android 4.0 (API Level 14 compatible) and that you are compiling with the latest tools. Note: The user is responsible for configuring the Calendar application with the appropriate Calendar accounts (e.g. Adding new events to the Calendar is simple and requires no special application permissions. Applications can access the Calendar using the new APIs available in Android 4.0. The Calendar is a common application that users rely upon on their Android devices. One of the most common tasks that developers often want to be able to do is create new events in the user’s calendar, so today we’ll show you how. For the first time, the SDK provides access to the Calendar application in a legitimate fashion. The latest version of the Android SDK, code-named Ice Cream Sandwich, reached developers this week.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |