Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is CalendarContract.EventsColumns.CUSTOM_APP_URI for?

The title says it all: what is CalendarContract.EventsColumns.CUSTOM_APP_URI for?

I ask because I'm looking for a place that my app can stuff some app-specific data into the Events table. Perhaps this is a futile question, because of course, I need to be sure that some other app doesn't trash my data.

Maybe a better question is: how can I store app-specific data in the calendar events table?

like image 697
Peri Hartman Avatar asked Jan 24 '13 21:01

Peri Hartman


1 Answers

As mentined in the CalendarContract:

/**
 * Activity Action: Display the event to the user in the custom app as
 * specified in {@link EventsColumns#CUSTOM_APP_PACKAGE}. The custom app
 * will be started via {@link Activity#startActivityForResult(Intent, int)}
 * and it should call {@link Activity#setResult(int)} with
 * {@link Activity#RESULT_OK} or {@link Activity#RESULT_CANCELED} to
 * acknowledge whether the action was handled or not.
 *
 * The custom app should have an intent-filter like the following
 * <pre>
 * {@code
 * <intent-filter>
 *    <action android:name="android.provider.calendar.action.HANDLE_CUSTOM_EVENT" />
 *    <category android:name="android.intent.category.DEFAULT" />
 *    <data android:mimeType="vnd.android.cursor.item/event" />
 * </intent-filter>
 * }
 * </pre>
 * <p>
 * Input: {@link Intent#getData} has the event URI. The extra
 * {@link #EXTRA_EVENT_BEGIN_TIME} has the start time of the instance. The
 * extra {@link #EXTRA_CUSTOM_APP_URI} will have the
 * {@link EventsColumns#CUSTOM_APP_URI}.
 * <p>
 * Output: {@link Activity#RESULT_OK} if this was handled; otherwise
 * {@link Activity#RESULT_CANCELED}
 */

// @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_HANDLE_CUSTOM_EVENT = "android.provider.calendar.action.HANDLE_CUSTOM_EVENT";

like image 63
Moritz Avatar answered Oct 18 '22 08:10

Moritz